How to use the cross-domain-utils/src.isWindow function in cross-domain-utils

To help you get started, we’ve selected a few cross-domain-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github krakenjs / zoid / src / component / props.js View on Github external
validate({ value } : { value : CrossDomainWindowType | ProxyWindow }) {
                if (!isWindow(value) && !ProxyWindow.isProxyWindow(value)) {
                    throw new Error(`Expected Window or ProxyWindow`);
                }

                if (isWindow(value)) {
                    // $FlowFixMe
                    if (isWindowClosed(value)) {
                        throw new Error(`Window is closed`);
                    }

                    // $FlowFixMe
                    if (!isSameDomain(value)) {
                        throw new Error(`Window is not same domain`);
                    }
                }
            },
            decorate({ value } : { value : CrossDomainWindowType | ProxyWindow }) : ProxyWindow {
github krakenjs / zoid / src / component / props.js View on Github external
validate({ value } : { value : CrossDomainWindowType | ProxyWindow }) {
                if (!isWindow(value) && !ProxyWindow.isProxyWindow(value)) {
                    throw new Error(`Expected Window or ProxyWindow`);
                }

                if (isWindow(value)) {
                    // $FlowFixMe
                    if (isWindowClosed(value)) {
                        throw new Error(`Window is closed`);
                    }

                    // $FlowFixMe
                    if (!isSameDomain(value)) {
                        throw new Error(`Window is not same domain`);
                    }
                }
            },
            decorate({ value } : { value : CrossDomainWindowType | ProxyWindow }) : ProxyWindow {
github krakenjs / post-robot / src / serialize / window.js View on Github external
static isProxyWindow(obj : CrossDomainWindowType | ProxyWindow) : boolean {
        // $FlowFixMe
        return Boolean(obj && !isWindow(obj) && obj.isProxyWindow);
    }
github krakenjs / zoid / dist / module / component / component / props.js View on Github external
validate: function validate(val) {
                if (!isWindow(val) && !ProxyWindow.isProxyWindow(val)) {
                    throw new Error('Expected Window or ProxyWindow');
                }
            },
            decorate: function decorate(val) {
github krakenjs / zoid / src / component / component.js View on Github external
return ZalgoPromise.try(() => {
                if (!isWindow(target)) {
                    throw new Error(`Must pass window to renderTo`);
                }

                return this.getDefaultContext(context, props);
                
            }).then(finalContext => {
                container = this.getDefaultContainer(finalContext, container);
github krakenjs / post-robot / src / serialize / serialize.js View on Github external
[ TYPE.OBJECT ]:   (val : CrossDomainWindowType) : Object | SerializedWindow => {
            return (isWindow(val) || ProxyWindow.isProxyWindow(val)) ? serializeWindow(destination, domain, val, { on, send }) : val;
        }
    });