UNPKG

@shopify/app-bridge

Version:

**Shopify is doubling our engineering staff in 2021! [Join our team and work on libraries like this one.](https://smrtr.io/5GGrc)**

27 lines (26 loc) 719 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getWindow = exports.getLocation = exports.redirect = exports.shouldRedirect = void 0; function shouldRedirect(frame) { return frame === window; } exports.shouldRedirect = shouldRedirect; function redirect(url) { var location = getLocation(); if (!location) { return; } location.assign(url); } exports.redirect = redirect; function getLocation() { return hasWindow() ? window.location : undefined; } exports.getLocation = getLocation; function getWindow() { return hasWindow() ? window : undefined; } exports.getWindow = getWindow; function hasWindow() { return typeof window !== 'undefined'; }