UNPKG

penpal

Version:

A promise-based library for communicating with iframes via postMessage.

9 lines (8 loc) 254 B
import { ErrorCode } from '../enums'; export default () => { if (window === window.top) { const error = new Error('connectToParent() must be called within an iframe'); error.code = ErrorCode.NotInIframe; throw error; } };