diff --git a/.yarn/patches/lodash-npm-4.17.21-6382451519.patch b/.yarn/patches/lodash-npm-4.17.21-6382451519.patch new file mode 100644 index 000000000000..bce2def3a979 --- /dev/null +++ b/.yarn/patches/lodash-npm-4.17.21-6382451519.patch @@ -0,0 +1,44 @@ +diff --git a/_PATCH.txt b/_PATCH.txt +new file mode 100644 +index 0000000000000000000000000000000000000000..94d9729bdc09c57a213683e048f1edb9b0d8fe42 +--- /dev/null ++++ b/_PATCH.txt +@@ -0,0 +1,2 @@ ++This patch fixes a bug in Lodash when it's run in a contentscript on Firefox. ++See here for details: https://github.com/lodash/lodash/issues/5934 +diff --git a/_freeGlobal.js b/_freeGlobal.js +index bbec998fc8cbaaeec1f848017aa8e232d4d419eb..37addf20c9846f1729b83c67746714e6bcc6565d 100644 +--- a/_freeGlobal.js ++++ b/_freeGlobal.js +@@ -1,4 +1,4 @@ + /** Detect free variable `global` from Node.js. */ +-var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; ++var freeGlobal = typeof globalThis == 'object' && globalThis && globalThis.Object === Object && globalThis; + + module.exports = freeGlobal; +diff --git a/core.js b/core.js +index be1d567d629fdfda05efcaa6adfb480d93702889..c74af2204241654129a4b8d9bc8e1ad235c464f1 100644 +--- a/core.js ++++ b/core.js +@@ -62,7 +62,7 @@ + }; + + /** Detect free variable `global` from Node.js. */ +- var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; ++ var freeGlobal = typeof globalThis == 'object' && globalThis && globalThis.Object === Object && globalThis; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; +diff --git a/lodash.js b/lodash.js +index 4131e936cd1e0521ac7be3a9d4bfb9f1fdb35462..5febc1c8b908871a65db4ffcc8ed4a42f9c648be 100644 +--- a/lodash.js ++++ b/lodash.js +@@ -427,7 +427,7 @@ + freeParseInt = parseInt; + + /** Detect free variable `global` from Node.js. */ +- var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; ++ var freeGlobal = typeof globalThis == 'object' && globalThis && globalThis.Object === Object && globalThis; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index b620376cdd2b..8e57d6474490 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -1301,7 +1301,6 @@ "setTimeout": true }, "packages": { - "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/controller-utils>@metamask/ethjs-unit": true, "@metamask/utils": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, @@ -1309,7 +1308,8 @@ "browserify>buffer": true, "cockatiel": true, "eth-ens-namehash": true, - "eslint>fast-deep-equal": true + "eslint>fast-deep-equal": true, + "lodash": true } }, "@metamask/delegation-controller": { diff --git a/lavamoat/browserify/experimental/policy.json b/lavamoat/browserify/experimental/policy.json index b620376cdd2b..8e57d6474490 100644 --- a/lavamoat/browserify/experimental/policy.json +++ b/lavamoat/browserify/experimental/policy.json @@ -1301,7 +1301,6 @@ "setTimeout": true }, "packages": { - "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/controller-utils>@metamask/ethjs-unit": true, "@metamask/utils": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, @@ -1309,7 +1308,8 @@ "browserify>buffer": true, "cockatiel": true, "eth-ens-namehash": true, - "eslint>fast-deep-equal": true + "eslint>fast-deep-equal": true, + "lodash": true } }, "@metamask/delegation-controller": { diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index b620376cdd2b..8e57d6474490 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -1301,7 +1301,6 @@ "setTimeout": true }, "packages": { - "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/controller-utils>@metamask/ethjs-unit": true, "@metamask/utils": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, @@ -1309,7 +1308,8 @@ "browserify>buffer": true, "cockatiel": true, "eth-ens-namehash": true, - "eslint>fast-deep-equal": true + "eslint>fast-deep-equal": true, + "lodash": true } }, "@metamask/delegation-controller": { diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index b620376cdd2b..8e57d6474490 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -1301,7 +1301,6 @@ "setTimeout": true }, "packages": { - "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/controller-utils>@metamask/ethjs-unit": true, "@metamask/utils": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, @@ -1309,7 +1308,8 @@ "browserify>buffer": true, "cockatiel": true, "eth-ens-namehash": true, - "eslint>fast-deep-equal": true + "eslint>fast-deep-equal": true, + "lodash": true } }, "@metamask/delegation-controller": { diff --git a/package.json b/package.json index 6e6092a1660e..365eaf194843 100644 --- a/package.json +++ b/package.json @@ -234,7 +234,8 @@ "@ledgerhq/errors": "^6.21.0", "nanoid@npm:^5.1.5": "^3.3.8", "tar-fs@npm:^2.1.0": "^2.1.3", - "lodash.memoize@npm:^4.1.2": "patch:lodash.memoize@npm%3A4.1.2#~/.yarn/patches/lodash.memoize-npm-4.1.2-0e6250041f.patch" + "lodash.memoize@npm:^4.1.2": "patch:lodash.memoize@npm%3A4.1.2#~/.yarn/patches/lodash.memoize-npm-4.1.2-0e6250041f.patch", + "lodash": "patch:lodash@npm%3A4.17.21#~/.yarn/patches/lodash-npm-4.17.21-6382451519.patch" }, "dependencies": { "@babel/runtime": "patch:@babel/runtime@npm%3A7.25.9#~/.yarn/patches/@babel-runtime-npm-7.25.9-fe8c62510a.patch", @@ -271,7 +272,7 @@ "@metamask/browser-passworder": "^4.3.0", "@metamask/chain-agnostic-permission": "^0.8.0", "@metamask/contract-metadata": "^2.5.0", - "@metamask/controller-utils": "^11.9.0", + "@metamask/controller-utils": "^11.11.0", "@metamask/delegation-controller": "^0.4.0", "@metamask/delegation-deployments": "^0.11.0", "@metamask/design-system-react": "^0.1.0", diff --git a/yarn.lock b/yarn.lock index e60c15755831..cff44b759995 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5751,14 +5751,13 @@ __metadata: languageName: node linkType: hard -"@metamask/controller-utils@npm:^11.0.0, @metamask/controller-utils@npm:^11.10.0, @metamask/controller-utils@npm:^11.3.0, @metamask/controller-utils@npm:^11.5.0, @metamask/controller-utils@npm:^11.6.0, @metamask/controller-utils@npm:^11.9.0": - version: 11.10.0 - resolution: "@metamask/controller-utils@npm:11.10.0" +"@metamask/controller-utils@npm:^11.0.0, @metamask/controller-utils@npm:^11.10.0, @metamask/controller-utils@npm:^11.11.0, @metamask/controller-utils@npm:^11.3.0, @metamask/controller-utils@npm:^11.5.0, @metamask/controller-utils@npm:^11.6.0, @metamask/controller-utils@npm:^11.9.0": + version: 11.11.0 + resolution: "@metamask/controller-utils@npm:11.11.0" dependencies: - "@ethereumjs/util": "npm:^9.1.0" "@metamask/eth-query": "npm:^4.0.0" "@metamask/ethjs-unit": "npm:^0.3.0" - "@metamask/utils": "npm:^11.2.0" + "@metamask/utils": "npm:^11.4.2" "@spruceid/siwe-parser": "npm:2.1.0" "@types/bn.js": "npm:^5.1.5" bignumber.js: "npm:^9.1.2" @@ -5766,9 +5765,10 @@ __metadata: cockatiel: "npm:^3.1.2" eth-ens-namehash: "npm:^2.0.8" fast-deep-equal: "npm:^3.1.3" + lodash: "npm:^4.17.21" peerDependencies: "@babel/runtime": ^7.0.0 - checksum: 10/e563d1705ddba1b4cf2903827bd9a47d95700b150e17d3c5b57dcdd9b51d3f8e2bee9daaa6d2d5718beba3e28498be06d308daba2c294adf0716bb34894d0c96 + checksum: 10/9b4ac01beb7359fea6da869117be69f8973d2d0e190469773b5f2726b86ccf0150d455bf8b19e9aa0504228fb2fb5fb7e9334a66df83cd2d02a4c84f250dad5a languageName: node linkType: hard @@ -31104,13 +31104,20 @@ __metadata: languageName: node linkType: hard -"lodash@npm:4.17.21, lodash@npm:^4, lodash@npm:^4.16.4, lodash@npm:^4.17.11, lodash@npm:^4.17.14, lodash@npm:^4.17.15, lodash@npm:^4.17.19, lodash@npm:^4.17.20, lodash@npm:^4.17.21, lodash@npm:^4.17.4, lodash@npm:^4.7.0": +"lodash@npm:4.17.21": version: 4.17.21 resolution: "lodash@npm:4.17.21" checksum: 10/c08619c038846ea6ac754abd6dd29d2568aa705feb69339e836dfa8d8b09abbb2f859371e86863eda41848221f9af43714491467b5b0299122431e202bb0c532 languageName: node linkType: hard +"lodash@patch:lodash@npm%3A4.17.21#~/.yarn/patches/lodash-npm-4.17.21-6382451519.patch": + version: 4.17.21 + resolution: "lodash@patch:lodash@npm%3A4.17.21#~/.yarn/patches/lodash-npm-4.17.21-6382451519.patch::version=4.17.21&hash=a39172" + checksum: 10/c9fdcf4cf6440e980aaa687aa7a787afb4563502c28e88eb230c3adfac0aa6b2ccb96aaf4a17c0148c3daa2d8cc83edad8ecedd8ed64a615b47f07b0f484cd9c + languageName: node + linkType: hard + "log-symbols@npm:4.1.0, log-symbols@npm:^4.0.0, log-symbols@npm:^4.1.0": version: 4.1.0 resolution: "log-symbols@npm:4.1.0" @@ -31952,7 +31959,7 @@ __metadata: "@metamask/build-utils": "npm:^3.0.0" "@metamask/chain-agnostic-permission": "npm:^0.8.0" "@metamask/contract-metadata": "npm:^2.5.0" - "@metamask/controller-utils": "npm:^11.9.0" + "@metamask/controller-utils": "npm:^11.11.0" "@metamask/delegation-controller": "npm:^0.4.0" "@metamask/delegation-deployments": "npm:^0.11.0" "@metamask/design-system-react": "npm:^0.1.0"