How to use the cross-domain-utils/src.getActualDomain 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 / post-robot / src / drivers / send / strategies.js View on Github external
return WILDCARD;
                }

                if (!isActuallySameDomain(win)) {
                    throw new Error(`Attempting to send messsage to mock domain ${ dom }, but window is actually cross-domain`);
                }

                // $FlowFixMe
                const windowDomain = getDomain(win);
                
                if (windowDomain !== dom) {
                    throw new Error(`Mock domain target ${ dom } does not match window domain ${ windowDomain }`);
                }

                // $FlowFixMe
                return getActualDomain(win);

            }
        }
        
        if (dom.indexOf(PROTOCOL.FILE) === 0) {
            return WILDCARD;
        }

        return dom;
    });
github paypal / paypal-checkout-components / src / config / util.js View on Github external
export function buildUrl(domain : string, uri? : string) : string {
    if (domain.indexOf('mock://') === 0 && typeof window !== 'undefined') {
        domain = getActualDomain();
    }
    return `${ domain }${ uri || '' }`;
}
github paypal / paypal-sdk-client / dist / module / config.js View on Github external
export function buildPayPalUrl() {
    var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';

    return __TEST__ && __WEB__ ? '' + getActualDomain() + path : '' + getPayPalDomain() + path;
}
github paypal / paypal-sdk-client / src / config.js View on Github external
export function buildPayPalAPIUrl(path : string = '') : string {
    const paypalAPIDomain = isCurrentDomain(getPayPalDomain())
        ? getPayPalDomain()
        : getPayPalAPIDomain();

    return (__TEST__ && __WEB__)
        ? `${ getActualDomain() }${ path }`
        : `${ paypalAPIDomain }${ path }`;
}
github paypal / paypal-sdk-client / src / config.js View on Github external
export function buildPayPalUrl(path : string = '') : string {
    return (__TEST__ && __WEB__)
        ? `${ getActualDomain() }${ path }`
        : `${ getPayPalDomain() }${ path }`;
}
github paypal / paypal-sdk-client / dist / module / config.js View on Github external
export function buildPayPalAPIUrl() {
    var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';

    var paypalAPIDomain = isCurrentDomain(getPayPalDomain()) ? getPayPalDomain() : getPayPalAPIDomain();

    return __TEST__ && __WEB__ ? '' + getActualDomain() + path : '' + paypalAPIDomain + path;
}