How to use the post-robot/src.toProxyWindow function in post-robot

To help you get started, we’ve selected a few post-robot 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
decorate({ value } : { value : CrossDomainWindowType | ProxyWindow }) : ProxyWindow {
                return toProxyWindow(value);
            }
        },
github krakenjs / zoid / src / component / component.js View on Github external
return ZalgoPromise.try(() => {
            if (props.window) {
                return toProxyWindow(props.window).getType();
            }
    
            if (context) {
                if (context !== CONTEXT.IFRAME && context !== CONTEXT.POPUP) {
                    throw new Error(`Unrecognized context: ${ context }`);
                }
                
                return context;
            }
    
            return this.defaultContext;
        });
    }
github krakenjs / zoid / src / parent / drivers.js View on Github external
}).then(win => {
                return toProxyWindow(win);
            });
        });
github krakenjs / zoid / src / parent / index.js View on Github external
return ZalgoPromise.try(() => {
            const windowProp = this.props.window;

            if (windowProp) {
                const proxyWin = toProxyWindow(windowProp);
                this.clean.register(() => windowProp.close());
                return proxyWin;
            }

            return new ProxyWindow({ send });
        });
    }