How to use the post-robot/src.bridge.openBridge 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 paypal / paypal-checkout-components / src / compat / fallback.js View on Github external
return ZalgoPromise.try(() => {
        if (bridge && !isPayPalDomain()) {
            return bridge.openBridge(extendUrl(config.postBridgeUrl, { version: getScriptVersion() }), config.postBridgeDomain).then((postBridge : CrossDomainWindowType) => {
                return send(postBridge, 'onLegacyPaymentAuthorize', { method }, { domain: config.paypalDomain })
                    .then(noop);
            });
        }
    });
}
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 / lib / meta.js View on Github external
return ZalgoPromise.try(() => {
            if (!bridge) {
                throw new Error(`Opening meta window without bridge support is not currently supported`);
            }

            let metaListener = once('meta', { domain: metaFrameDomain });

            return bridge.openBridge(metaFrameUrl, metaFrameDomain)
                .then(() => metaListener)
                .then(({ data }) => data);
        });
    });
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);
        });
    }