How to use the post-robot/src.bridge.needsBridge 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 / parent / index.js View on Github external
}).then(win => {
                if (!bridge || !bridge.needsBridge({ win, domain }) || bridge.hasBridge(domain, domain)) {
                    return;
                }

                const bridgeUrl = this.component.getBridgeUrl();

                if (!bridgeUrl) {
                    throw new Error(`Bridge needed to render ${ context }`);
                }

                const bridgeDomain = getDomainFromUrl(bridgeUrl);
                bridge.linkUrl(win, domain);
                return bridge.openBridge(normalizeMockUrl(bridgeUrl), bridgeDomain);
            });
        }
github krakenjs / zoid / src / component / parent / index.js View on Github external
}).then(win => {
            if (!bridge || !bridge.needsBridge({ win, domain }) || bridge.hasBridge(domain, domain)) {
                return;
            }

            let bridgeUrl = this.component.getBridgeUrl(this.props);

            if (!bridgeUrl) {
                throw new Error(`Bridge url and domain needed to render ${ context }`);
            }

            let bridgeDomain = getDomainFromUrl(bridgeUrl);
            bridge.linkUrl(win, domain);
            return bridge.openBridge(bridgeUrl, bridgeDomain);
        });
    }
github krakenjs / zoid / dist / module / component / parent / index.js View on Github external
}).then(function (win) {
            if (!bridge || !bridge.needsBridge({ win: win, domain: domain }) || bridge.hasBridge(domain, domain)) {
                return;
            }

            var bridgeUrl = _this7.component.getBridgeUrl(_this7.props);

            if (!bridgeUrl) {
                throw new Error('Bridge url and domain needed to render ' + context);
            }

            var bridgeDomain = getDomainFromUrl(bridgeUrl);
            bridge.linkUrl(win, domain);
            return bridge.openBridge(bridgeUrl, bridgeDomain);
        });
    };
github paypal / paypal-checkout-components / src / legacy / postBridge.js View on Github external
return ZalgoPromise.try(() => {

        let metaFrameDomain : string = config.paypalDomains[env];

        if (!bridge || !bridge.needsBridge({ domain: metaFrameDomain })) {
            return debug(`post_bridge_not_required`, { env });
        }

        debug(`setup_post_bridge`, { env });

        return openMetaFrame(env).then(noop);
    });
}