UNPKG

@spectra/window-day-care

Version:

A library to help you create popup windows and iframes. It makes communication between parent and child window a breeze.

14 lines (11 loc) 392 B
import { ChildWindow } from './child-window'; import { Iframe } from './iframe.child-window'; export function inject(target: HTMLElement): ChildWindow { const iframe = document.createElement('iframe'); iframe.style.display = 'none'; target.appendChild(iframe); return new Iframe(iframe); } export function injectIntoBody(): ChildWindow { return inject(document.body); }