Skip to content

feat: enhance getPlatform to detect additional Chromium browsers#39705

Merged
DDDDDanica merged 20 commits intomainfrom
browser_detection
Feb 6, 2026
Merged

feat: enhance getPlatform to detect additional Chromium browsers#39705
DDDDDanica merged 20 commits intomainfrom
browser_detection

Conversation

@gauthierpetetin
Copy link
Contributor

@gauthierpetetin gauthierpetetin commented Feb 2, 2026

Description

This PR achieves the following:

  • Increase the number of browsers we differentiate, by adding individual platform detection for Vivaldi, Yandex, Samsung Internet, Whale, Puffin, Silk, UCBrowser, Maxthon, Cốc Cốc, QQ Browser, and Chromium.
  • Unknown browsers now return PLATFORM_OTHER instead of defaulting to PLATFORM_CHROME.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: null

Related issues

NA

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

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

Medium Risk
Changes browser/platform detection used by analytics and conditional runtime behavior, so mis-detections could affect event tagging and platform-specific logic across the extension.

Overview
getPlatform is expanded from a small set of browsers to a hybrid detector that distinguishes many Chromium-based browsers (e.g., Vivaldi, Yandex, Samsung Internet, Whale, Puffin, Silk, UC Browser, Maxthon, Cốc Cốc, QQ Browser, Chromium, and Edge Android) and returns PLATFORM_OTHER for unknown user agents instead of defaulting to Chrome.

Detection now prefers explicit User-Agent signatures and falls back to navigator.userAgentData.brands (with noise filtering) to identify browsers that mask themselves as Chrome, returning unmapped meaningful brands for analytics discovery. Multiple-instance detection is adjusted to ping Firefox IDs only on Firefox and otherwise always use Chrome Web Store IDs, and tests are updated/added to cover the new platform constants and detection behavior (including stabilizing MetaMetrics platform trait tests by mocking getPlatform).

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

Add individual platform detection for Vivaldi, Yandex, Samsung Internet,
Whale, Puffin, Silk, UCBrowser, Maxthon, Cốc Cốc, QQ Browser, and Chromium.
Unknown browsers now return PLATFORM_OTHER instead of defaulting to Chrome.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gauthierpetetin gauthierpetetin self-assigned this Feb 2, 2026
@gauthierpetetin gauthierpetetin added the team-extension-platform Extension Platform team label Feb 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2026

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.

@github-actions github-actions bot added the size-M label Feb 2, 2026
if (getPlatform() !== PLATFORM_CHROME && getPlatform() !== PLATFORM_FIREFOX) {
const platform = getPlatform();

if (platform !== PLATFORM_CHROME && platform !== PLATFORM_FIREFOX) {
Copy link
Contributor Author

@gauthierpetetin gauthierpetetin Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems it was intentional here to send the ping message to other extensions only for PLATFORM_CHROME (which we were defaulting to) and PLATFORM_FIREFOX browsers, but not for PLATFORM_OPERA, PLATFORM_BRAVE or PLATFORM_EDGE.

I don't have the context on why it was like this, but I wanted to highlight it here just in case someone has more context, and also because the behavior will change for browsers that were previously defaulting to PLATFORM_CHROME and that will now fall into one of these buckets:

  • PLATFORM_CHROMIUM
  • PLATFORM_COCCOC
  • PLATFORM_MAXTHON
  • PLATFORM_OTHER
  • PLATFORM_PUFFIN
  • PLATFORM_QQBROWSER
  • PLATFORM_SAMSUNG
  • PLATFORM_SILK
  • PLATFORM_UCBROWSER
  • PLATFORM_VIVALDI
  • PLATFORM_WHALE
  • PLATFORM_YANDEX

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is any reason to skip the check on other browsers

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, it's now updated in this commit: 8268fba

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 2, 2026

Builds ready [eb5db0b]
UI Startup Metrics (1332 ± 116 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--13321086170711614031513
load--1137920152311712131320
domContentLoaded--1130914151511612081314
domInteractive--281795182481
firstPaint--168651206178190307
backgroundConnect--23521735318237276
firstReactRender--16103441725
initialActions--105113
loadScripts--91068113011219861097
setupStore--1363651522
numNetworkReqs--211583171572
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--21561560842992020624077
load--1088959179314710891446
domContentLoaded--1072946178414710781435
domInteractive--38191822936114
firstPaint--216841499226238368
backgroundConnect--43829025464283471429
firstReactRender--25175782750
initialActions--105112
loadScripts--83572215091358351173
setupStore--1563261829
numNetworkReqs--1265225755162242
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--8716951095929251027
load--72661692582801872
domContentLoaded--72161292081796864
domInteractive--2815138202484
firstPaint--1136430956139228
backgroundConnect--39191362541106
firstReactRender--16103751728
initialActions--102111
loadScripts--71861091880791857
setupStore--1274761324
numNetworkReqs--221592181576
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1241878177022714861622
load--6996061030100706978
domContentLoaded--6906021024100695972
domInteractive--34171232434106
firstPaint--1296647970147272
backgroundConnect--15012936137149233
firstReactRender--21173132227
initialActions--104111
loadScripts--687600101799693965
setupStore--1141731216
numNetworkReqs--1105323344147195
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--13901130189718114951844
load--1120946169513511901371
domContentLoaded--1120946169513511901371
domInteractive--66332144487150
firstPaint--------
backgroundConnect--62232514670162
firstReactRender--189475471234
initialActions--102012
loadScripts--1088933166912411601279
setupStore--135114151039
numNetworkReqs--231285181878
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--25902005377036327203622
load--12771067225223912971823
domContentLoaded--12771067225223812971823
domInteractive--13437683123134532
firstPaint--------
backgroundConnect--263104953193278882
firstReactRender--21157582330
initialActions--203123
loadScripts--12341045217121912531784
setupStore--1219761166114576
numNetworkReqs--76392154595191
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--16221344220018817512016
load--13781154185314714561654
domContentLoaded--13781154185314714561654
domInteractive--913223145132183
firstPaint--------
backgroundConnect--63232214274152
firstReactRender--14112931520
initialActions--102122
loadScripts--13391139182013014171581
setupStore--165208271250
numNetworkReqs--241288201884
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--30442288877674531224278
load--16641300720764317162654
domContentLoaded--16641299720764317162654
domInteractive--175344629463127512
firstPaint--------
backgroundConnect--3121231229248287903
firstReactRender--23164252531
initialActions--204123
loadScripts--16171229706663216602445
setupStore--1609777213159750
numNetworkReqs--75352544583183
19--------
📊 Page Load Benchmark Results

Current Commit: eb5db0b | Date: 2/2/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±37ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 719ms (±35ms) 🟢 | historical mean value: 721ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±13ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 37ms 1.01s 1.31s 1.06s 1.31s
domContentLoaded 719ms 35ms 701ms 978ms 748ms 978ms
firstPaint 77ms 13ms 60ms 200ms 84ms 200ms
firstContentfulPaint 77ms 13ms 60ms 200ms 84ms 200ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 432 Bytes (0.01%)
  • ui: 92 Bytes (0%)
  • common: 1.67 KiB (0.02%)

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 2, 2026

Builds ready [0a7bc3a]
UI Startup Metrics (1320 ± 104 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--13201075158510413971491
load--1123912137310411921295
domContentLoaded--1117909135610311851291
domInteractive--2716121192378
firstPaint--185641181198195353
backgroundConnect--23221527910236254
firstReactRender--19115172234
initialActions--107114
loadScripts--89967411281049711070
setupStore--1365061724
numNetworkReqs--221582181575
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--19421569256114820182216
load--1066939172514110621429
domContentLoaded--1051935171914210441420
domInteractive--3519142223591
firstPaint--186711386144235352
backgroundConnect--31928545331330392
firstReactRender--24164672940
initialActions--109113
loadScripts--81769114641368091170
setupStore--1674671837
numNetworkReqs--1184924854145241
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--83866910831059061036
load--68459691982764839
domContentLoaded--67959391582759833
domInteractive--251684172174
firstPaint--945827042107182
backgroundConnect--3819123244398
firstReactRender--1593451729
initialActions--109114
loadScripts--67659191381756826
setupStore--1266271222
numNetworkReqs--221585181574
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1232863182623714041748
load--702606105199710989
domContentLoaded--693599104299702980
domInteractive--34181582732101
firstPaint--1476552992171398
backgroundConnect--15413037543151300
firstReactRender--22173942329
initialActions--102112
loadScripts--691598103297700971
setupStore--1152631317
numNetworkReqs--975025249101214
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--14781140206720716181833
load--1192977168915013101475
domContentLoaded--1192976168815013101474
domInteractive--813325351110193
firstPaint--------
backgroundConnect--792620653119184
firstReactRender--1495381339
initialActions--2034322
loadScripts--1147959158512712211381
setupStore--145204241043
numNetworkReqs--231288191881
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--27132002662959327993961
load--12901039243226312451900
domContentLoaded--12891039243226212441899
domInteractive--12341703107115365
firstPaint--------
backgroundConnect--3261231395278324946
firstReactRender--22157982329
initialActions--2153523
loadScripts--12341021214721512101817
setupStore--1899811231313696
numNetworkReqs--72402274790193
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--16951388268719418322018
load--14381196195012315061656
domContentLoaded--14381196195012315061656
domInteractive--923021042132153
firstPaint--------
backgroundConnect--71263815873175
firstReactRender--15114841621
initialActions--1013112
loadScripts--13961180184210514601569
setupStore--204284451287
numNetworkReqs--231288181973
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--28072081430945230503728
load--15611251268429016922240
domContentLoaded--15601251268429016912239
domInteractive--1053373391108213
firstPaint--------
backgroundConnect--2931061220235300938
firstReactRender--21147172430
initialActions--207123
loadScripts--14991225244325016461980
setupStore--1507736198217674
numNetworkReqs--71381934391185
19--------
📊 Page Load Benchmark Results

Current Commit: 0a7bc3a | Date: 2/2/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±38ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 724ms (±36ms) 🟢 | historical mean value: 721ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±10ms) 🟢 | historical mean value: 77ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 38ms 1.02s 1.34s 1.06s 1.34s
domContentLoaded 724ms 36ms 704ms 1.01s 745ms 1.01s
firstPaint 76ms 10ms 60ms 160ms 84ms 160ms
firstContentfulPaint 76ms 10ms 60ms 160ms 84ms 160ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 32 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 1.12 KiB (0.01%)

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 2, 2026

Builds ready [073ecb3]
UI Startup Metrics (1366 ± 93 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1366113816109314381497
load--118198313858612381298
domContentLoaded--117497813778712331286
domInteractive--261689182377
firstPaint--153671237126193305
backgroundConnect--23221530215234266
firstReactRender--17104251927
initialActions--105114
loadScripts--95775311548710171073
setupStore--1264161521
numNetworkReqs--211581171572
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--313018269029134039725817
load--13131111192314513691677
domContentLoaded--12891098191414113391613
domInteractive--41201633138141
firstPaint--218801217140279367
backgroundConnect--878310487988611032896
firstReactRender--27185573041
initialActions--103112
loadScripts--1033851161512710861311
setupStore--18787122146
numNetworkReqs--1035921338117199
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--86366711181159641053
load--7275981031105795918
domContentLoaded--7215941023104784913
domInteractive--241680152271
firstPaint--1076231747139199
backgroundConnect--38171512942127
firstReactRender--15104361629
initialActions--106113
loadScripts--7185921021103777911
setupStore--1163041221
numNetworkReqs--211584171571
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1337870200125515641736
load--73765112561137341023
domContentLoaded--72464212511137201016
domInteractive--36181552535103
firstPaint--1637346884217301
backgroundConnect--16613175177158348
firstReactRender--23173742532
initialActions--102111
loadScripts--72264012441117181008
setupStore--1252941518
numNetworkReqs--1607433855173289
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--17271377232818718342121
load--14381210198213415361682
domContentLoaded--14361204197713415351681
domInteractive--813522941114145
firstPaint--------
backgroundConnect--822929453113194
firstReactRender--13112821416
initialActions--102022
loadScripts--13931195195412114691608
setupStore--2262244114123
numNetworkReqs--231194191879
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--31642162758981032854501
load--16341299607768915792358
domContentLoaded--16341299607668915792358
domInteractive--161341310149199383
firstPaint--------
backgroundConnect--47311612063236951142
firstReactRender--19146771829
initialActions--203122
loadScripts--15821264603366315272142
setupStore--12111699159104617
numNetworkReqs--944323947100224
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--16321354218418017202086
load--13971168165111214731590
domContentLoaded--13961168165111314731589
domInteractive--923018839130142
firstPaint--------
backgroundConnect--732325852109189
firstReactRender--14112631419
initialActions--102122
loadScripts--1354115516279514171515
setupStore--144146221167
numNetworkReqs--221282151763
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--30382131772370732543855
load--16561298612457616582366
domContentLoaded--16551298612357616582365
domInteractive--14248592103165418
firstPaint--------
backgroundConnect--47112413622977001015
firstReactRender--21155652329
initialActions--103122
loadScripts--16031276607356915922341
setupStore--12015781150129473
numNetworkReqs--90382494789215
19--------
📊 Page Load Benchmark Results

Current Commit: 073ecb3 | Date: 2/2/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±41ms) 🟡 | historical mean value: 1.02s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 723ms (±38ms) 🟢 | historical mean value: 712ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 78ms (±13ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 41ms 1.01s 1.34s 1.07s 1.34s
domContentLoaded 723ms 38ms 698ms 1.00s 746ms 1.00s
firstPaint 78ms 13ms 60ms 192ms 88ms 192ms
firstContentfulPaint 78ms 13ms 60ms 192ms 88ms 192ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 32 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 1.12 KiB (0.01%)

Update the PLATFORM object to include all new platform constants
so the Platform type includes them for type safety.

Co-authored-by: Cursor <cursoragent@cursor.com>
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 3, 2026

Builds ready [ef69433]
UI Startup Metrics (1386 ± 104 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--13861165166110414351585
load--1186961144910012401370
domContentLoaded--117995814439912311362
domInteractive--2616101192283
firstPaint--151671151118191272
backgroundConnect--23221031415236266
firstReactRender--16102631922
initialActions--106113
loadScripts--96173712209910121155
setupStore--1163241319
numNetworkReqs--211584171572
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--19821613299020320622357
load--11481017210415811361543
domContentLoaded--11341010209015811201523
domInteractive--36191792733110
firstPaint--205741631208228405
backgroundConnect--32828553947338447
firstReactRender--23155272542
initialActions--104112
loadScripts--89578017541448791260
setupStore--1673761731
numNetworkReqs--1234826355144252
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--83867211321089061059
load--702594105496760897
domContentLoaded--697589104695752891
domInteractive--241697172173
firstPaint--996132546109180
backgroundConnect--36171342539110
firstReactRender--15103151626
initialActions--107112
loadScripts--694587104495750888
setupStore--1154161124
numNetworkReqs--221583171575
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1257915188821914041678
load--71862411301147111045
domContentLoaded--70761811111136961036
domInteractive--36192283334107
firstPaint--169641132169185533
backgroundConnect--16412941254164318
firstReactRender--23174042532
initialActions--102011
loadScripts--70561611021116941027
setupStore--1252131417
numNetworkReqs--1244926158155252
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--15931293215116916791948
load--13441141174011914241577
domContentLoaded--13431137173911914201575
domInteractive--70332033791142
firstPaint--------
backgroundConnect--63252143862157
firstReactRender--1292021214
initialActions--102012
loadScripts--13131128162510713811521
setupStore--1256191234
numNetworkReqs--231294201785
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--31462386540863831674698
load--16641313262834418472368
domContentLoaded--16631313262434418472367
domInteractive--12539595107122365
firstPaint--------
backgroundConnect--2871171452244300936
firstReactRender--18143032025
initialActions--203123
loadScripts--16051290249130518012210
setupStore--1929807248293777
numNetworkReqs--723718543104176
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--16671412227516717921941
load--14381217179912415301680
domContentLoaded--14371213179912515301680
domInteractive--913025250132197
firstPaint--------
backgroundConnect--732619043102162
firstReactRender--14113531519
initialActions--104122
loadScripts--13931193177811314821590
setupStore--164226271266
numNetworkReqs--231284181875
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--29772102753872934174203
load--16691258604356418232481
domContentLoaded--16691258604256318232481
domInteractive--10932668104102334
firstPaint--------
backgroundConnect--3231151383278344933
firstReactRender--21143242329
initialActions--103122
loadScripts--16041241601454517112303
setupStore--20471238260338750
numNetworkReqs--70351874192180
19--------
📊 Page Load Benchmark Results

Current Commit: ef69433 | Date: 2/3/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.02s (±37ms) 🟡 | historical mean value: 1.02s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 710ms (±35ms) 🟢 | historical mean value: 712ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 74ms (±11ms) 🟢 | historical mean value: 79ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.02s 37ms 1.00s 1.31s 1.03s 1.31s
domContentLoaded 710ms 35ms 694ms 983ms 716ms 983ms
firstPaint 74ms 11ms 56ms 160ms 80ms 160ms
firstContentfulPaint 74ms 11ms 56ms 160ms 80ms 160ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 32 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 1.25 KiB (0.01%)

Add waitFor to ensure async localforage cache updates complete
before asserting cache keys, fixing race condition in CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
Mock getPlatform() to return PLATFORM_CHROME in the _buildUserTraitsObject
tests to ensure consistent behavior across test environments.

Co-authored-by: Cursor <cursoragent@cursor.com>
…rands

- Add BRAND_TO_PLATFORM_MAP for browsers detectable via userAgentData.brands
- Split getPlatform into getPlatformFromUserAgent and getPlatformFromBrands
- UA string detection takes priority; brands used as fallback
- Enables detection of Lemur, Mises, Brave that hide identity in UA string
- Consolidate browser UA tests using parameterized it.each

Co-authored-by: Cursor <cursoragent@cursor.com>
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 5, 2026

Builds ready [f31f0a3]
UI Startup Metrics (1508 ± 109 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup15081272178710915791659
load13021017158411013801434
domContentLoaded12951014157911013721420
domInteractive291896192587
firstPaint1656640780223267
backgroundConnect25322331316260283
firstReactRender18114251925
initialActions105113
loadScripts1057779133411211381195
setupStore1373051621
numNetworkReqs231586201581
BrowserifyPower User HomeuiStartup273913529966151230235402
load12351024186316113091540
domContentLoaded12141011185315912711522
domInteractive43182604736128
firstPaint252791627210264432
backgroundConnect78826744858326652787
firstReactRender22153442430
initialActions103111
loadScripts985803161514910421273
setupStore1353651521
numNetworkReqs1196023341148194
WebpackStandard HomeuiStartup83465811751109131041
load707590101499788890
domContentLoaded702585100899779884
domInteractive251493182277
firstPaint1016029047115196
backgroundConnect3417107183875
firstReactRender1693761828
initialActions104112
loadScripts699583100698776882
setupStore1152541219
numNetworkReqs231596211585
WebpackPower User HomeuiStartup1253910221025113031763
load73361411511217401060
domContentLoaded72160711441237261055
domInteractive37181642737101
firstPaint1507057391173303
backgroundConnect195130874142166411
firstReactRender21174442230
initialActions104111
loadScripts71960511351207241045
setupStore1353051622
numNetworkReqs1506024642172224
FirefoxBrowserifyStandard HomeuiStartup17751408242421818862173
load14771230206218015691801
domContentLoaded14761230205618015691801
domInteractive77352033998139
firstPaint------
backgroundConnect82332375086195
firstReactRender14112421418
initialActions103122
loadScripts14331208203215915201745
setupStore236232401385
numNetworkReqs241295211782
BrowserifyPower User HomeuiStartup28462083740961229623554
load15581286580950115661786
domContentLoaded15581285580950115651786
domInteractive161481830192196314
firstPaint------
backgroundConnect49614018823397161088
firstReactRender18146562025
initialActions103122
loadScripts15141263577650015261762
setupStore11713713150117495
numNetworkReqs914216128109144
WebpackStandard HomeuiStartup16291365211516217261915
load13891189172210314541561
domContentLoaded13881189172210314531561
domInteractive923030846131146
firstPaint------
backgroundConnect69262124573167
firstReactRender15116061520
initialActions103112
loadScripts1350114916989413981487
setupStore1961893113100
numNetworkReqs231290191873
WebpackPower User HomeuiStartup28541985936498829063598
load16701224780186216162237
domContentLoaded16691223780186216162237
domInteractive16752525122178461
firstPaint------
backgroundConnect42212115062995441010
firstReactRender20153442326
initialActions216122
loadScripts16231200766685115912029
setupStore14915731163173516
numNetworkReqs904220331102147
📊 Page Load Benchmark Results

Current Commit: f31f0a3 | Date: 2/5/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±63ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 732ms (±61ms) 🟢 | historical mean value: 730ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±9ms) 🟢 | historical mean value: 77ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 63ms 1.02s 1.33s 1.26s 1.33s
domContentLoaded 732ms 61ms 699ms 1.00s 935ms 1.00s
firstPaint 77ms 9ms 60ms 148ms 84ms 148ms
firstContentfulPaint 77ms 9ms 60ms 148ms 84ms 148ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -33 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 2.16 KiB (0.02%)

@gauthierpetetin
Copy link
Contributor Author

I tested browsers listed in the PR. Given that many have different ways to define the user agent and navigator.userAgentData, I thought it would be helpful to keep track of it here:

Firefox
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:147.0) Gecko/20100101 Firefox/147.0

userAgentData not available

Chrome
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36

{
  "brands": [
    {
      "brand": "Not(A:Brand",
      "version": "8"
    },
    {
      "brand": "Chromium",
      "version": "144"
    },
    {
      "brand": "Google Chrome",
      "version": "144"
    }
  ],
  "mobile": false,
  "platform": "macOS"
}

Brave
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36

{
  "brands": [
    {
      "brand": "Not(A:Brand",
      "version": "8"
    },
    {
      "brand": "Chromium",
      "version": "144"
    },
    {
      "brand": "Brave",
      "version": "144"
    }
  ],
  "mobile": false,
  "platform": "macOS"
}

Edge
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36 Edg/144.0.0.0

{
  "brands": [
    {
      "brand": "Not(A:Brand",
      "version": "8"
    },
    {
      "brand": "Chromium",
      "version": "144"
    },
    {
      "brand": "Microsoft Edge",
      "version": "144"
    }
  ],
  "mobile": false,
  "platform": "macOS"
}

Opera
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 OPR/126.0.0.0

{
  "brands": [
    {
      "brand": "Chromium",
      "version": "142"
    },
    {
      "brand": "Opera",
      "version": "126"
    },
    {
      "brand": "Not_A Brand",
      "version": "99"
    }
  ],
  "mobile": false,
  "platform": "macOS"
}

Coc Coc
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36

{
  "brands": [
    {
      "brand": "Google Chrome",
      "version": "143"
    },
    {
      "brand": "Chromium",
      "version": "143"
    },
    {
      "brand": "Not A(Brand",
      "version": "24"
    }
  ],
  "mobile": false,
  "platform": "macOS"
}

Maxthon
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36

{
  "brands": [
    {
      "brand": "Not;A=Brand",
      "version": "99"
    },
    {
      "brand": "Google Chrome",
      "version": "139"
    },
    {
      "brand": "Chromium",
      "version": "139"
    }
  ],
  "mobile": false,
  "platform": "macOS"
}

UC
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 UCPC/1.1.0.15

{
  "brands": [
    {
      "brand": "Not?A_Brand",
      "version": "99"
    },
    {
      "brand": "Chromium",
      "version": "130"
    }
  ],
  "mobile": false,
  "platform": "macOS"
}

Vivaldi
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36

{
  "brands": [
    {
      "brand": "Not(A:Brand",
      "version": "8"
    },
    {
      "brand": "Chromium",
      "version": "144"
    },
    {
      "brand": "Google Chrome",
      "version": "144"
    }
  ],
  "mobile": false,
  "platform": "macOS"
}

Whale
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Whale/4.35.351.16 Safari/537.36

{
  "brands": [
    {
      "brand": "Chromium",
      "version": "142"
    },
    {
      "brand": "Whale",
      "version": "4"
    },
    {
      "brand": "Not.A/Brand",
      "version": "99"
    }
  ],
  "mobile": false,
  "platform": "macOS"
}

Yandex
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 YaBrowser/25.12.0.0 Safari/537.36

{
  "brands": [
    {
      "brand": "Chromium",
      "version": "142"
    },
    {
      "brand": "YaBrowser",
      "version": "25.12"
    },
    {
      "brand": "Not_A Brand",
      "version": "99"
    },
    {
      "brand": "Yowser",
      "version": "2.5"
    }
  ],
  "mobile": false,
  "platform": "macOS"
}

EdgeAndroid
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Mobile Safari/537.36 EdgA/144.0.0.0

{
  "brands": [
    {
      "brand": "Not(A:Brand",
      "version": "8"
    },
    {
      "brand": "Chromium",
      "version": "144"
    },
    {
      "brand": "Microsoft Edge",
      "version": "144"
    }
  ],
  "mobile": true,
  "platform": "Android"
}

Kiwi
Mozilla/5.0 (Android 16; Mobile; rv:128.0) Gecko/128.0 Firefox/128.0

userAgentData not available

Lemur
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Mobile Safari/537.36

{
  "brands": [
    {
      "brand": "Chromium",
      "version": "127"
    },
    {
      "brand": "Not)A;Brand",
      "version": "99"
    },
    {
      "brand": "Microsoft Edge Simulate",
      "version": "127"
    },
    {
      "brand": "Lemur",
      "version": "127"
    }
  ],
  "mobile": true,
  "platform": "Android"
}

Mises
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36

{
  "brands": [
    {
      "brand": "Mises",
      "version": "141"
    },
    {
      "brand": "Not?A_Brand",
      "version": "8"
    },
    {
      "brand": "Chromium",
      "version": "141"
    }
  ],
  "mobile": true,
  "platform": "Android"
}

Samsung Internet
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/29.0 Chrome/136.0.0.0 Mobile Safari/537.36

{
  "brands": [
    {
      "brand": "Chromium",
      "version": "136"
    },
    {
      "brand": "Samsung Internet",
      "version": "29.0"
    },
    {
      "brand": "Not.A/Brand",
      "version": "99"
    }
  ],
  "mobile": true,
  "platform": "Android"
}

@gauthierpetetin
Copy link
Contributor Author

gauthierpetetin commented Feb 5, 2026

As @davidmurdoch recommended on Slack, I started looking at this new experimental API, i.e. navigator.userAgentData in addition to user agent, and for some browsers (Brave, Lemur, Mises), it allows to identify the browser while user agent doesn't.

For that reason, I started using a hybrid browser detection approach in commit 1feaaa5, using both user agent and navigator.userAgentData:

  • If the browser can be deduced from the user agent, we deduce it from there
  • If not, we deduce it from navigator.userAgentData (new experimental API)
  • If not, we set it to PLATFORM_OTHER

This new experimental API also allows us to know if the user is on mobile or not, which we could add to Segment user traits, but I'd rather do that in a different PR.

- Add 'Google Chrome' to BRAND_TO_PLATFORM_MAP for correct Chrome detection
- Filter out noise brands (Chromium, GREASE brands) case-insensitively
- Return unknown meaningful brands for analytics discovery
- Alphabetize BRAND_TO_PLATFORM_MAP keys for consistency

Co-authored-by: Cursor <cursoragent@cursor.com>
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 5, 2026

Builds ready [496644f]
UI Startup Metrics (1429 ± 108 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup14291196195810814921608
load1216997170810712831355
domContentLoaded1210992168010612771348
domInteractive2716105202479
firstPaint166661307175198334
backgroundConnect23921548529239273
firstReactRender17114451824
initialActions107113
loadScripts989772144410410521114
setupStore1272741420
numNetworkReqs231584201582
BrowserifyPower User HomeuiStartup17241362228416817951978
load11321003177416211131562
domContentLoaded1114995168415310921545
domInteractive3317186263285
firstPaint190691678172237342
backgroundConnect32127248038331404
firstReactRender21145672236
initialActions104111
loadScripts87776514031448561285
setupStore1574361729
numNetworkReqs1225228049140235
WebpackStandard HomeuiStartup8806981115999451050
load73161094786805868
domContentLoaded72560594185794863
domInteractive261696182276
firstPaint12159801102135228
backgroundConnect3719134234084
firstReactRender15113651728
initialActions104112
loadScripts72260393984792855
setupStore1262841321
numNetworkReqs231598211582
WebpackPower User HomeuiStartup1222855179918613281616
load70160910651146931018
domContentLoaded69260510541146821011
domInteractive3416160263296
firstPaint1296336969146254
backgroundConnect15413028131159225
firstReactRender21164242327
initialActions103111
loadScripts68960310441126781002
setupStore1152231315
numNetworkReqs1054529054112238
FirefoxBrowserifyStandard HomeuiStartup16521316249624318362083
load13931146206421314901827
domContentLoaded13921145206421314901827
domInteractive66291833785147
firstPaint------
backgroundConnect71262064272162
firstReactRender1291811314
initialActions102122
loadScripts13561124195219214751703
setupStore144146191234
numNetworkReqs251295231890
BrowserifyPower User HomeuiStartup28152047651162629313881
load15761262515545716102269
domContentLoaded15761262515545716102268
domInteractive11833619117107398
firstPaint------
backgroundConnect3791161587319513973
firstReactRender19146792026
initialActions2147522
loadScripts15221229512344514902177
setupStore1368709184134561
numNetworkReqs67381423294132
WebpackStandard HomeuiStartup16061378204516516921946
load13741199166110314401543
domContentLoaded13741194166010314401543
domInteractive852820840125134
firstPaint------
backgroundConnect71201954587163
firstReactRender14102321518
initialActions102022
loadScripts1335118016439313811493
setupStore2162734112102
numNetworkReqs231283171871
WebpackPower User HomeuiStartup27471959701564428583728
load16041271573351116922315
domContentLoaded16031269573351116922315
domInteractive12532698142104532
firstPaint------
backgroundConnect2861171390263282908
firstReactRender22156582431
initialActions207123
loadScripts15461208570749116592047
setupStore16481277233135688
numNetworkReqs66351603293123
📊 Page Load Benchmark Results

Current Commit: 496644f | Date: 2/5/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.08s (±39ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 756ms (±37ms) 🟢 | historical mean value: 730ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 82ms (±11ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.08s 39ms 1.06s 1.37s 1.10s 1.37s
domContentLoaded 756ms 37ms 732ms 1.03s 782ms 1.03s
firstPaint 82ms 11ms 64ms 172ms 88ms 172ms
firstContentfulPaint 82ms 11ms 64ms 172ms 88ms 172ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -33 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 2.3 KiB (0.02%)

- Group Brave/Lemur/Mises tests using parameterized it.each
- Fix test title to reflect Google Chrome is now a known brand
- Rename FutureBrowser to DiscoveredBrowser for clarity

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-project-automation github-project-automation bot moved this from Needs dev review to Review finalised - Ready to be merged in PR review queue Feb 6, 2026
@DDDDDanica DDDDDanica added this pull request to the merge queue Feb 6, 2026
@DDDDDanica
Copy link
Contributor

LGTM !

Merged via the queue into main with commit de9e7c5 Feb 6, 2026
182 checks passed
@DDDDDanica DDDDDanica deleted the browser_detection branch February 6, 2026 14:30
@github-project-automation github-project-automation bot moved this from Review finalised - Ready to be merged to Merged, Closed or Archived in PR review queue Feb 6, 2026
@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2026
@metamaskbot metamaskbot added the release-13.19.0 Issue or pull request that will be included in release 13.19.0 label Feb 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.19.0 Issue or pull request that will be included in release 13.19.0 size-L team-extension-platform Extension Platform team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants