Skip to content

Commit

Permalink
revent a webpage document element to be detected as the Extension API…
Browse files Browse the repository at this point in the history
… object when running in content scripts

mozilla/webextension-polyfill#153
  • Loading branch information
HaNdTriX committed Aug 15, 2018
1 parent b95bc59 commit 744bb51
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -41,7 +41,7 @@
"copy-webpack-plugin": "^4.5.1",
"find-up": "^3.0.0",
"string-replace-loader": "^2.1.1",
"webextension-polyfill": "^0.3.0",
"webextension-polyfill": "0.3.0",
"webpack": "^4.12.0",
"webpack-watched-glob-entries-plugin": "^2.1.2",
"webpack-webextension-plugin": "^0.1.1",
Expand Down
2 changes: 1 addition & 1 deletion src/webpack-config.js
Expand Up @@ -128,7 +128,7 @@ module.exports = function webpackConfig ({
loader: require.resolve('string-replace-loader'),
query: {
search: 'typeof browser === "undefined"',
replace: 'typeof window.browser === "undefined"'
replace: 'typeof window.browser === "undefined" || Object.getPrototypeOf(browser) !== Object.prototype'
}
})
}
Expand Down

0 comments on commit 744bb51

Please sign in to comment.