Skip to content

Conversation

mindofmar
Copy link
Contributor

@mindofmar mindofmar commented Oct 14, 2025

Description

This PR makes several small optimizations and bug fixes to the way we capture metrics and display URLs for our phishing page.

  • Improves consistency: Metrics always uses hostname now. Previously, blockedUrl being set to details.initiator would add a https:// prefix to our metrics whereas hostname would be tracked without it.
  • Bug fix: for c2 domain blocks, we previously would display the c2 itself on the phishing page and as the 'Proceed anyway' link. This PR changes it to use the actual domain that the request came from, in order to improve clarity for the user.
  • Bug fix: Fixes: https://github.com/MetaMask/MetaMask-planning/issues/6038

Changelog

CHANGELOG entry: fix: use correct href for phishing page proceed anyway button

Open in GitHub Codespaces

Screenshots/Recordings

Before

Website blocked by c2:

image

After

Website blocked by c2:

image

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Corrects phishing warning flow to display/proceed to the correct URL while standardizing metrics to use hostname.

  • Background phishing detection (app/scripts/background.js):
    • Use href as blockedUrl and derive blockedHostname safely (fallback to original hostname/href on parse errors).
    • Metrics: send url and referrer.url as blockedHostname for consistency.
    • C2-detected requests: override blockedUrl with details.initiator for display/proceed behavior.
    • Redirect params: set hostname to blockedHostname and href to blockedUrl for the phishing warning page.

Written by Cursor Bugbot for commit 879d2b4. This will update automatically on new commits. Configure here.

Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-product-safety Push issues to Product Safety team label Oct 14, 2025
@mindofmar mindofmar marked this pull request as ready for review October 14, 2025 22:01
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Oct 14, 2025
cursor[bot]

This comment was marked as outdated.

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: e22fdb4 | Date: 10/14/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±73ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 730ms (±69ms) 🟢 | historical mean value: 738ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 75ms (±12ms) 🟢 | historical mean value: 77ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 73ms 1.00s 1.32s 1.26s 1.32s
domContentLoaded 730ms 69ms 693ms 1.00s 937ms 1.00s
firstPaint 75ms 12ms 56ms 176ms 84ms 176ms
firstContentfulPaint 75ms 12ms 56ms 176ms 84ms 176ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [e22fdb4]
UI Startup Metrics (1232 ± 64 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1232110613616412821346
load106196611975811031157
domContentLoaded105696411945710961152
domInteractive17134861734
firstPaint61588119743710741140
backgroundConnect2522373049255271
firstReactRender2618143132541
getState12590101228
initialActions40254413
loadScripts80970594057845907
setupStore86233913
WebpackHomeuiStartup814700109568831940
load62557793967634797
domContentLoaded61857192165628790
domInteractive1711192191442
firstPaint19256960192187598
backgroundConnect20104862330
firstReactRender271784103240
getState841931012
initialActions208237
loadScripts61556991163627779
setupStore84172911
FirefoxBrowserifyHomeuiStartup13771196191013314421713
load1174103414448712411323
domContentLoaded1174103314438712411322
domInteractive98323736099251
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2918113173187
firstReactRender29253833036
getState10320027527
initialActions4014515212
loadScripts1151101413508212071294
setupStore12416823654
WebpackHomeuiStartup1478130519099215211637
load1296116215106713441412
domContentLoaded1295116215106713441411
domInteractive903424535102162
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3018106153367
firstReactRender322474123370
getState629810513
initialActions401701729
loadScripts1272114714826413141388
setupStore73426624
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 86 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 10 Bytes (0%)

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: e22fdb4 | Date: 10/15/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±46ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 722ms (±41ms) 🟢 | historical mean value: 739ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±15ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 46ms 1.01s 1.40s 1.07s 1.40s
domContentLoaded 722ms 41ms 703ms 1.05s 753ms 1.05s
firstPaint 77ms 15ms 60ms 216ms 84ms 216ms
firstContentfulPaint 77ms 15ms 60ms 216ms 84ms 216ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [e22fdb4]
UI Startup Metrics (1248 ± 65 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1248112314086513021361
load107197512145611121172
domContentLoaded106497212105511061165
domInteractive18146581740
firstPaint71190122443310871171
backgroundConnect25523832312259272
firstReactRender26195772741
getState1357391729
initialActions41275513
loadScripts81673296654850916
setupStore1053441017
WebpackHomeuiStartup803696103968817948
load62157589866626777
domContentLoaded61356988165621769
domInteractive15116391334
firstPaint19555904189191595
backgroundConnect20104972330
firstReactRender2716114113135
getState84203914
initialActions2011236
loadScripts61056787063619759
setupStore84162912
FirefoxBrowserifyHomeuiStartup14151211187112714841678
load1212103815659712921370
domContentLoaded1212103815659712911370
domInteractive103343646194271
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect29198093345
firstReactRender30255053141
getState73779515
initialActions30788212
loadScripts1191102015259412701344
setupStore12420926747
WebpackHomeuiStartup15571361198212815881839
load1349121517169213881538
domContentLoaded1348121417169213871538
domInteractive993236567102326
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect311892113546
firstReactRender372681143776
getState9211219657
initialActions5012915222
loadScripts1325119816939013701516
setupStore10414417741
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 86 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 10 Bytes (0%)

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 80bac5e | Date: 10/16/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±70ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 730ms (±82ms) 🟢 | historical mean value: 738ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 80ms (±41ms) 🟢 | historical mean value: 78ms ⬆️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 70ms 993ms 1.31s 1.23s 1.31s
domContentLoaded 730ms 82ms 692ms 1.26s 921ms 1.26s
firstPaint 80ms 41ms 60ms 484ms 92ms 484ms
firstContentfulPaint 80ms 41ms 60ms 484ms 92ms 484ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [80bac5e]
UI Startup Metrics (1258 ± 70 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1258109914827013081374
load108096112776711311198
domContentLoaded107495512726611261192
domInteractive18145271740
firstPaint70688121243411131186
backgroundConnect2542422797258267
firstReactRender27185572944
getState1555072028
initialActions61306718
loadScripts826714101165880942
setupStore1163251223
WebpackHomeuiStartup854714111067870967
load64258191467645790
domContentLoaded63357590566640782
domInteractive161268101541
firstPaint19455915186200635
backgroundConnect23124172937
firstReactRender28176783335
getState941731215
initialActions319246
loadScripts63057389464638772
setupStore1162731316
FirefoxBrowserifyHomeuiStartup14161221179310814491647
load1206105613857512501343
domContentLoaded1206105513857512501342
domInteractive1083328047114223
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect32207183844
firstReactRender25216552635
getState1038310819
initialActions41344310
loadScripts1185104013697512321325
setupStore145181231126
WebpackHomeuiStartup15581407193010216001797
load1341118416489013941528
domContentLoaded1341118416479013941526
domInteractive98303816094233
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect351982114055
firstReactRender34268393646
getState9313313814
initialActions41365313
loadScripts1319116616258913691501
setupStore1166181133
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -70.01 KiB (-1.54%)
  • ui: 10.86 KiB (0.17%)
  • common: 70.9 KiB (0.85%)

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 879d2b4 | Date: 10/17/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±76ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 742ms (±87ms) 🟢 | historical mean value: 740ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 80ms (±43ms) 🟢 | historical mean value: 78ms ⬆️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 76ms 1.01s 1.37s 1.31s 1.37s
domContentLoaded 742ms 87ms 702ms 1.30s 987ms 1.30s
firstPaint 80ms 43ms 64ms 504ms 88ms 504ms
firstContentfulPaint 80ms 43ms 64ms 504ms 88ms 504ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [879d2b4]
UI Startup Metrics (1236 ± 62 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1236112614106212671366
load106397312295310921163
domContentLoaded105796912265210891149
domInteractive1914138181737
firstPaint67671117543210731157
backgroundConnect2552403008257270
firstReactRender25194152537
getState1565591837
initialActions51668617
loadScripts80872395950836894
setupStore1063041120
WebpackHomeuiStartup8217001098708371039
load62056793664628785
domContentLoaded61256392463620776
domInteractive15116291341
firstPaint18957925170189588
backgroundConnect21114062632
firstReactRender2816240223134
getState942331113
initialActions3015246
loadScripts60956191361618766
setupStore1052531214
FirefoxBrowserifyHomeuiStartup14901295212313315421758
load1267111215418513311393
domContentLoaded1267111115418513311393
domInteractive1163539157125250
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3619155164055
firstReactRender26217362637
getState94284916
initialActions6117318411
loadScripts1243109215158413111376
setupStore175219361053
WebpackHomeuiStartup15691359211013216111838
load1341118416579313951545
domContentLoaded1341118316579313951545
domInteractive1153538775111359
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3618137173975
firstReactRender312292153077
getState11416221818
initialActions41304312
loadScripts1318115915538813711523
setupStore136130191049
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -44.82 KiB (-0.99%)
  • ui: 10.86 KiB (0.17%)
  • common: 73.2 KiB (0.88%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template size-S team-product-safety Push issues to Product Safety team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants