Skip to content

Commit

Permalink
Merge branch 'develop' into chore/portfolio-view-swap-check
Browse files Browse the repository at this point in the history
  • Loading branch information
gambinish authored Nov 27, 2024
2 parents 954652b + 6aeb777 commit 8a8f65c
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 134 deletions.
7 changes: 5 additions & 2 deletions app/scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,24 +284,27 @@ function maybeDetectPhishing(theController) {

// Determine the block reason based on the type
let blockReason;
let blockedUrl = hostname;
if (phishingTestResponse?.result && blockedRequestResponse.result) {
blockReason = `${phishingTestResponse.type} and ${blockedRequestResponse.type}`;
} else if (phishingTestResponse?.result) {
blockReason = phishingTestResponse.type;
} else {
blockReason = blockedRequestResponse.type;
blockedUrl = details.initiator;
}

theController.metaMetricsController.trackEvent({
// should we differentiate between background redirection and content script redirection?
event: MetaMetricsEventName.PhishingPageDisplayed,
category: MetaMetricsEventCategory.Phishing,
properties: {
url: hostname,
url: blockedUrl,
referrer: {
url: hostname,
url: blockedUrl,
},
reason: blockReason,
requestDomain: blockedRequestResponse.result ? hostname : undefined,
},
});
const querystring = new URLSearchParams({ hostname, href });
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/inpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ cleanContextForImports();
import log from 'loglevel';
import { v4 as uuid } from 'uuid';
import { WindowPostMessageStream } from '@metamask/post-message-stream';
import { initializeProvider } from '@metamask/providers/dist/initializeInpageProvider';
import { initializeProvider } from '@metamask/providers/initializeInpageProvider';
import shouldInjectProvider from '../../shared/modules/provider-injection';

// contexts
Expand Down
19 changes: 3 additions & 16 deletions lavamoat/browserify/beta/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -834,25 +834,12 @@
"setTimeout": true
},
"packages": {
"@metamask/eth-json-rpc-middleware>@metamask/json-rpc-engine": true,
"@metamask/eth-json-rpc-middleware>@metamask/rpc-errors": true,
"@metamask/eth-json-rpc-middleware>@metamask/utils": true,
"@metamask/eth-json-rpc-middleware>klona": true,
"@metamask/eth-json-rpc-middleware>safe-stable-stringify": true,
"@metamask/eth-sig-util": true
}
},
"@metamask/eth-json-rpc-middleware>@metamask/json-rpc-engine": {
"packages": {
"@metamask/eth-json-rpc-middleware>@metamask/rpc-errors": true,
"@metamask/eth-json-rpc-middleware>@metamask/utils": true,
"@metamask/safe-event-emitter": true
}
},
"@metamask/eth-json-rpc-middleware>@metamask/rpc-errors": {
"packages": {
"@metamask/eth-json-rpc-middleware>@metamask/utils": true,
"@metamask/rpc-errors>fast-safe-stringify": true
"@metamask/eth-sig-util": true,
"@metamask/json-rpc-engine": true,
"@metamask/rpc-errors": true
}
},
"@metamask/eth-json-rpc-middleware>@metamask/utils": {
Expand Down
19 changes: 3 additions & 16 deletions lavamoat/browserify/flask/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -834,25 +834,12 @@
"setTimeout": true
},
"packages": {
"@metamask/eth-json-rpc-middleware>@metamask/json-rpc-engine": true,
"@metamask/eth-json-rpc-middleware>@metamask/rpc-errors": true,
"@metamask/eth-json-rpc-middleware>@metamask/utils": true,
"@metamask/eth-json-rpc-middleware>klona": true,
"@metamask/eth-json-rpc-middleware>safe-stable-stringify": true,
"@metamask/eth-sig-util": true
}
},
"@metamask/eth-json-rpc-middleware>@metamask/json-rpc-engine": {
"packages": {
"@metamask/eth-json-rpc-middleware>@metamask/rpc-errors": true,
"@metamask/eth-json-rpc-middleware>@metamask/utils": true,
"@metamask/safe-event-emitter": true
}
},
"@metamask/eth-json-rpc-middleware>@metamask/rpc-errors": {
"packages": {
"@metamask/eth-json-rpc-middleware>@metamask/utils": true,
"@metamask/rpc-errors>fast-safe-stringify": true
"@metamask/eth-sig-util": true,
"@metamask/json-rpc-engine": true,
"@metamask/rpc-errors": true
}
},
"@metamask/eth-json-rpc-middleware>@metamask/utils": {
Expand Down
19 changes: 3 additions & 16 deletions lavamoat/browserify/main/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -834,25 +834,12 @@
"setTimeout": true
},
"packages": {
"@metamask/eth-json-rpc-middleware>@metamask/json-rpc-engine": true,
"@metamask/eth-json-rpc-middleware>@metamask/rpc-errors": true,
"@metamask/eth-json-rpc-middleware>@metamask/utils": true,
"@metamask/eth-json-rpc-middleware>klona": true,
"@metamask/eth-json-rpc-middleware>safe-stable-stringify": true,
"@metamask/eth-sig-util": true
}
},
"@metamask/eth-json-rpc-middleware>@metamask/json-rpc-engine": {
"packages": {
"@metamask/eth-json-rpc-middleware>@metamask/rpc-errors": true,
"@metamask/eth-json-rpc-middleware>@metamask/utils": true,
"@metamask/safe-event-emitter": true
}
},
"@metamask/eth-json-rpc-middleware>@metamask/rpc-errors": {
"packages": {
"@metamask/eth-json-rpc-middleware>@metamask/utils": true,
"@metamask/rpc-errors>fast-safe-stringify": true
"@metamask/eth-sig-util": true,
"@metamask/json-rpc-engine": true,
"@metamask/rpc-errors": true
}
},
"@metamask/eth-json-rpc-middleware>@metamask/utils": {
Expand Down
19 changes: 3 additions & 16 deletions lavamoat/browserify/mmi/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -926,25 +926,12 @@
"setTimeout": true
},
"packages": {
"@metamask/eth-json-rpc-middleware>@metamask/json-rpc-engine": true,
"@metamask/eth-json-rpc-middleware>@metamask/rpc-errors": true,
"@metamask/eth-json-rpc-middleware>@metamask/utils": true,
"@metamask/eth-json-rpc-middleware>klona": true,
"@metamask/eth-json-rpc-middleware>safe-stable-stringify": true,
"@metamask/eth-sig-util": true
}
},
"@metamask/eth-json-rpc-middleware>@metamask/json-rpc-engine": {
"packages": {
"@metamask/eth-json-rpc-middleware>@metamask/rpc-errors": true,
"@metamask/eth-json-rpc-middleware>@metamask/utils": true,
"@metamask/safe-event-emitter": true
}
},
"@metamask/eth-json-rpc-middleware>@metamask/rpc-errors": {
"packages": {
"@metamask/eth-json-rpc-middleware>@metamask/utils": true,
"@metamask/rpc-errors>fast-safe-stringify": true
"@metamask/eth-sig-util": true,
"@metamask/json-rpc-engine": true,
"@metamask/rpc-errors": true
}
},
"@metamask/eth-json-rpc-middleware>@metamask/utils": {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@
"@metamask/ens-controller": "^14.0.0",
"@metamask/ens-resolver-snap": "^0.1.2",
"@metamask/eth-json-rpc-filters": "^9.0.0",
"@metamask/eth-json-rpc-middleware": "^14.0.2",
"@metamask/eth-json-rpc-middleware": "^15.0.0",
"@metamask/eth-ledger-bridge-keyring": "^5.0.1",
"@metamask/eth-query": "^4.0.0",
"@metamask/eth-sig-util": "^7.0.1",
Expand Down Expand Up @@ -333,7 +333,7 @@
"@metamask/ppom-validator": "0.35.1",
"@metamask/preinstalled-example-snap": "^0.2.0",
"@metamask/profile-sync-controller": "^2.0.0",
"@metamask/providers": "^14.0.2",
"@metamask/providers": "^18.2.0",
"@metamask/queued-request-controller": "^7.0.1",
"@metamask/rate-limit-controller": "^6.0.0",
"@metamask/rpc-errors": "^7.0.0",
Expand Down
72 changes: 7 additions & 65 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5305,25 +5305,6 @@ __metadata:
languageName: node
linkType: hard

"@metamask/eth-json-rpc-middleware@npm:^14.0.2":
version: 14.0.2
resolution: "@metamask/eth-json-rpc-middleware@npm:14.0.2"
dependencies:
"@metamask/eth-block-tracker": "npm:^11.0.1"
"@metamask/eth-json-rpc-provider": "npm:^4.1.1"
"@metamask/eth-sig-util": "npm:^7.0.3"
"@metamask/json-rpc-engine": "npm:^9.0.2"
"@metamask/rpc-errors": "npm:^6.3.1"
"@metamask/utils": "npm:^9.1.0"
"@types/bn.js": "npm:^5.1.5"
bn.js: "npm:^5.2.1"
klona: "npm:^2.0.6"
pify: "npm:^5.0.0"
safe-stable-stringify: "npm:^2.4.3"
checksum: 10/8094efcd23bb5a1335f7d41cfb6193e035cc30329c2989f09b65f8870178ce960a643a4818a00fc791076a51d629511190d54f3b327165ac6f966c307dc9b90d
languageName: node
linkType: hard

"@metamask/eth-json-rpc-middleware@npm:^15.0.0":
version: 15.0.0
resolution: "@metamask/eth-json-rpc-middleware@npm:15.0.0"
Expand Down Expand Up @@ -5365,7 +5346,7 @@ __metadata:
languageName: node
linkType: hard

"@metamask/eth-json-rpc-provider@npm:^4.0.0, @metamask/eth-json-rpc-provider@npm:^4.1.0, @metamask/eth-json-rpc-provider@npm:^4.1.1, @metamask/eth-json-rpc-provider@npm:^4.1.3, @metamask/eth-json-rpc-provider@npm:^4.1.5, @metamask/eth-json-rpc-provider@npm:^4.1.6":
"@metamask/eth-json-rpc-provider@npm:^4.0.0, @metamask/eth-json-rpc-provider@npm:^4.1.0, @metamask/eth-json-rpc-provider@npm:^4.1.3, @metamask/eth-json-rpc-provider@npm:^4.1.5, @metamask/eth-json-rpc-provider@npm:^4.1.6":
version: 4.1.6
resolution: "@metamask/eth-json-rpc-provider@npm:4.1.6"
dependencies:
Expand Down Expand Up @@ -6269,29 +6250,9 @@ __metadata:
languageName: node
linkType: hard

"@metamask/providers@npm:^14.0.2":
version: 14.0.2
resolution: "@metamask/providers@npm:14.0.2"
dependencies:
"@metamask/json-rpc-engine": "npm:^7.1.1"
"@metamask/object-multiplex": "npm:^2.0.0"
"@metamask/rpc-errors": "npm:^6.0.0"
"@metamask/safe-event-emitter": "npm:^3.0.0"
"@metamask/utils": "npm:^8.1.0"
detect-browser: "npm:^5.2.0"
extension-port-stream: "npm:^3.0.0"
fast-deep-equal: "npm:^3.1.3"
is-stream: "npm:^2.0.0"
json-rpc-middleware-stream: "npm:^5.0.1"
readable-stream: "npm:^3.6.2"
webextension-polyfill: "npm:^0.10.0"
checksum: 10/e5ad5d4261f7629df0fd2a7a60e5fbd5a0d39b54ab5b5917ddfc16f741e122625769d65d323c5a97d7dbe95be987e3d5cf1c2ca4fc28ed9f68dc369c9e3209f1
languageName: node
linkType: hard

"@metamask/providers@npm:^18.1.1":
version: 18.1.1
resolution: "@metamask/providers@npm:18.1.1"
"@metamask/providers@npm:^18.1.1, @metamask/providers@npm:^18.2.0":
version: 18.2.0
resolution: "@metamask/providers@npm:18.2.0"
dependencies:
"@metamask/json-rpc-engine": "npm:^10.0.1"
"@metamask/json-rpc-middleware-stream": "npm:^8.0.5"
Expand All @@ -6306,7 +6267,7 @@ __metadata:
readable-stream: "npm:^3.6.2"
peerDependencies:
webextension-polyfill: ^0.10.0 || ^0.11.0 || ^0.12.0
checksum: 10/dca428d84e490343d85921d4fb09216a0b64be59a036d7b4f7b5ca4e2581c29a4106d58ff9dfe0650dc2b9387dd2adad508fc61073a9fda8ebde8ee3a5137abe
checksum: 10/d808f14fc5cf6e240abec61c6b0cb93c0a1d883078ee3d005b9cd49c44e65767a4227d828b19c31500da8e94d85c3632d6957ab35da20b250f6f3a52746ed6b3
languageName: node
linkType: hard

Expand Down Expand Up @@ -24832,18 +24793,6 @@ __metadata:
languageName: node
linkType: hard

"json-rpc-middleware-stream@npm:^5.0.1":
version: 5.0.1
resolution: "json-rpc-middleware-stream@npm:5.0.1"
dependencies:
"@metamask/json-rpc-engine": "npm:^7.1.1"
"@metamask/safe-event-emitter": "npm:^3.0.0"
"@metamask/utils": "npm:^8.1.0"
readable-stream: "npm:^3.6.2"
checksum: 10/b5e9b2ae21cc93586f1f4d8c6543634406575bf9cb6e909a4b5d47359b44519f37192a0262279291e5cde0876a67928d26d7e420d9e2aaf7992083e2c1f97a37
languageName: node
linkType: hard

"json-rpc-random-id@npm:^1.0.0, json-rpc-random-id@npm:^1.0.1":
version: 1.0.1
resolution: "json-rpc-random-id@npm:1.0.1"
Expand Down Expand Up @@ -26790,7 +26739,7 @@ __metadata:
"@metamask/eslint-config-typescript": "npm:^9.0.1"
"@metamask/eslint-plugin-design-tokens": "npm:^1.1.0"
"@metamask/eth-json-rpc-filters": "npm:^9.0.0"
"@metamask/eth-json-rpc-middleware": "npm:^14.0.2"
"@metamask/eth-json-rpc-middleware": "npm:^15.0.0"
"@metamask/eth-json-rpc-provider": "npm:^4.1.6"
"@metamask/eth-ledger-bridge-keyring": "npm:^5.0.1"
"@metamask/eth-query": "npm:^4.0.0"
Expand Down Expand Up @@ -26829,7 +26778,7 @@ __metadata:
"@metamask/preferences-controller": "npm:^13.0.2"
"@metamask/preinstalled-example-snap": "npm:^0.2.0"
"@metamask/profile-sync-controller": "npm:^2.0.0"
"@metamask/providers": "npm:^14.0.2"
"@metamask/providers": "npm:^18.2.0"
"@metamask/queued-request-controller": "npm:^7.0.1"
"@metamask/rate-limit-controller": "npm:^6.0.0"
"@metamask/rpc-errors": "npm:^7.0.0"
Expand Down Expand Up @@ -37576,13 +37525,6 @@ __metadata:
languageName: node
linkType: hard

"webextension-polyfill@npm:^0.10.0":
version: 0.10.0
resolution: "webextension-polyfill@npm:0.10.0"
checksum: 10/51ff30ebed4b1aa802b7f0347f05021b2fe492078bb1a597223d43995fcee96e2da8f914a2f6e36f988c1877ed5ab36ca7077f2f3ab828955151a59e4c01bf7e
languageName: node
linkType: hard

"webextension-polyfill@npm:^0.8.0":
version: 0.8.0
resolution: "webextension-polyfill@npm:0.8.0"
Expand Down

0 comments on commit 8a8f65c

Please sign in to comment.