mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-25 03:20:23 +01:00
Fix SES lockdown on older browsers (#10014)
On older browsers that don't support `globalThis`[1], the SES lockdown throws an error. The `globalthis` shim has been added to all pages, to the background process, and to the `contentscript`. This should prevent the error on older browsers. [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis#Browser_compatibility
This commit is contained in:
parent
da5e5cd8b6
commit
d13aabde23
@ -10,6 +10,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div id="app-content"></div>
|
<div id="app-content"></div>
|
||||||
<div id="popover-content"></div>
|
<div id="popover-content"></div>
|
||||||
|
<script src="./globalthis.js" type="text/javascript" charset="utf-8"></script>
|
||||||
<script src="./initSentry.js" type="text/javascript" charset="utf-8"></script>
|
<script src="./initSentry.js" type="text/javascript" charset="utf-8"></script>
|
||||||
<script src="./lockdown.cjs" type="text/javascript" charset="utf-8"></script>
|
<script src="./lockdown.cjs" type="text/javascript" charset="utf-8"></script>
|
||||||
<script src="./runLockdown.js" type="text/javascript" charset="utf-8"></script>
|
<script src="./runLockdown.js" type="text/javascript" charset="utf-8"></script>
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
"author": "https://metamask.io",
|
"author": "https://metamask.io",
|
||||||
"background": {
|
"background": {
|
||||||
"scripts": [
|
"scripts": [
|
||||||
|
"globalthis.js",
|
||||||
"initSentry.js",
|
"initSentry.js",
|
||||||
"lockdown.cjs",
|
"lockdown.cjs",
|
||||||
"runLockdown.js",
|
"runLockdown.js",
|
||||||
@ -36,7 +37,12 @@
|
|||||||
"content_scripts": [
|
"content_scripts": [
|
||||||
{
|
{
|
||||||
"matches": ["file://*/*", "http://*/*", "https://*/*"],
|
"matches": ["file://*/*", "http://*/*", "https://*/*"],
|
||||||
"js": ["lockdown.cjs", "runLockdown.js", "contentscript.js"],
|
"js": [
|
||||||
|
"globalthis.js",
|
||||||
|
"lockdown.cjs",
|
||||||
|
"runLockdown.js",
|
||||||
|
"contentscript.js"
|
||||||
|
],
|
||||||
"run_at": "document_start",
|
"run_at": "document_start",
|
||||||
"all_frames": true
|
"all_frames": true
|
||||||
},
|
},
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
<img id="loading__spinner" src="./images/spinner.gif" alt="" />
|
<img id="loading__spinner" src="./images/spinner.gif" alt="" />
|
||||||
</div>
|
</div>
|
||||||
<div id="popover-content"></div>
|
<div id="popover-content"></div>
|
||||||
|
<script src="./globalthis.js" type="text/javascript" charset="utf-8"></script>
|
||||||
<script src="./initSentry.js" type="text/javascript" charset="utf-8"></script>
|
<script src="./initSentry.js" type="text/javascript" charset="utf-8"></script>
|
||||||
<script src="./lockdown.cjs" type="text/javascript" charset="utf-8"></script>
|
<script src="./lockdown.cjs" type="text/javascript" charset="utf-8"></script>
|
||||||
<script src="./runLockdown.js" type="text/javascript" charset="utf-8"></script>
|
<script src="./runLockdown.js" type="text/javascript" charset="utf-8"></script>
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>Ethereum Phishing Detection - MetaMask</title>
|
<title>Ethereum Phishing Detection - MetaMask</title>
|
||||||
|
<script src="./globalthis.js" type="text/javascript" charset="utf-8"></script>
|
||||||
<script src="./lockdown.cjs" type="text/javascript" charset="utf-8"></script>
|
<script src="./lockdown.cjs" type="text/javascript" charset="utf-8"></script>
|
||||||
<script src="./runLockdown.js" type="text/javascript" charset="utf-8"></script>
|
<script src="./runLockdown.js" type="text/javascript" charset="utf-8"></script>
|
||||||
<script src="./phishing-detect.js"></script>
|
<script src="./phishing-detect.js"></script>
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
<body style="width:357px; height:600px;">
|
<body style="width:357px; height:600px;">
|
||||||
<div id="app-content"></div>
|
<div id="app-content"></div>
|
||||||
<div id="popover-content"></div>
|
<div id="popover-content"></div>
|
||||||
|
<script src="./globalthis.js" type="text/javascript" charset="utf-8"></script>
|
||||||
<script src="./initSentry.js" type="text/javascript" charset="utf-8"></script>
|
<script src="./initSentry.js" type="text/javascript" charset="utf-8"></script>
|
||||||
<script src="./lockdown.cjs" type="text/javascript" charset="utf-8"></script>
|
<script src="./lockdown.cjs" type="text/javascript" charset="utf-8"></script>
|
||||||
<script src="./runLockdown.js" type="text/javascript" charset="utf-8"></script>
|
<script src="./runLockdown.js" type="text/javascript" charset="utf-8"></script>
|
||||||
|
@ -44,6 +44,10 @@ const copyTargets = [
|
|||||||
pattern: `*.html`,
|
pattern: `*.html`,
|
||||||
dest: ``,
|
dest: ``,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
src: `./node_modules/globalthis/dist/browser.js`,
|
||||||
|
dest: `globalthis.js`,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
src: `./node_modules/ses/dist/`,
|
src: `./node_modules/ses/dist/`,
|
||||||
pattern: `lockdown.cjs`,
|
pattern: `lockdown.cjs`,
|
||||||
|
@ -128,6 +128,7 @@
|
|||||||
"extensionizer": "^1.0.1",
|
"extensionizer": "^1.0.1",
|
||||||
"fast-json-patch": "^2.0.4",
|
"fast-json-patch": "^2.0.4",
|
||||||
"fuse.js": "^3.2.0",
|
"fuse.js": "^3.2.0",
|
||||||
|
"globalthis": "^1.0.1",
|
||||||
"human-standard-token-abi": "^2.0.0",
|
"human-standard-token-abi": "^2.0.0",
|
||||||
"json-rpc-engine": "^6.1.0",
|
"json-rpc-engine": "^6.1.0",
|
||||||
"json-rpc-middleware-stream": "^2.1.1",
|
"json-rpc-middleware-stream": "^2.1.1",
|
||||||
|
Loading…
Reference in New Issue
Block a user