Skip to content

Commit

Permalink
Fix Chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
ExE-Boss committed Jun 17, 2018
1 parent b3609f7 commit 73d5e4b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/browser-polyfill.js
Expand Up @@ -35,7 +35,7 @@ const isThenable = value => {
return value && typeof value === "object" && typeof value.then === "function";
};

if (!isDefined(window, "browser") || !(() => {
if (typeof browser === "undefined" || !(() => {
// If `browser.runtime.lastError` doesn’t exist, assume promies are supported.
let supportsPromises = !(isDefined(window.browser, "runtime")
? isDefined(window.browser.runtime, "lastError")
Expand Down Expand Up @@ -528,7 +528,7 @@ if (!isDefined(window, "browser") || !(() => {

// The build process adds a UMD wrapper around this file, which makes the
// `module` variable available.
module.exports = wrapAPIs(browser || chrome); // eslint-disable-line no-undef
module.exports = wrapAPIs(typeof browser !== "undefined" ? browser : chrome); // eslint-disable-line no-undef
} else {
module.exports = browser; // eslint-disable-line no-undef
}

0 comments on commit 73d5e4b

Please sign in to comment.