1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00
metamask-extension/app/scripts
Mark Stacey 1419c14fb6
Use pathname instead of URL for currentPath metrics parameter (#9158)
The `currentPath` parameter passed to our metrics utility had been
passed the full URL rather than just the path, contrary to what the
name would imply. We only used the path portion, so passing the full
URL did lead to complications.

Now just the `pathname` is passed in, rather than the full URL. This
simplifies the metrics logic, and it incidentally fixes two bugs.

The main bug fixed is regarding Firefox metrics. Previously we had
assumed the `currentPath` would start with `chrome-extension://`, which
of course was not true on Firefox. This lead to us incorrectly parsing
the `currentPath`, so path tracking was broken for Firefox events.
This broken parsing is now bypassed entirely, so metrics should now
work the same on Firefox as on Chrome.

The second bug was that we were incorrectly setting the tracking URL
for background events during tests. As a result, we were incorrectly
detecting ourselves as an internal site that had referred the user to
us. But this was not of major concern, since it only affected test
metrics (which get sent to the development Matomo project).

Lastly, this change let us discard the `pathname` parameter used in
the `overrides` parameter of the `metricsEvent` function. Now that
`currentPath` is equivalent to `pathname`, the `pathname` parameter is
redundant.
2020-08-07 15:32:46 -03:00
..
account-import-strategies Clean up "JSON File" import strategy test output (#7855) 2020-01-17 19:59:47 -03:30
controllers Use async/await for getRestrictedMethods (#9099) 2020-07-29 19:50:20 -02:30
lib Use pathname instead of URL for currentPath metrics parameter (#9158) 2020-08-07 15:32:46 -03:00
migrations Enable guard-for-in rule (#9000) 2020-07-21 18:40:45 -02:30
platforms Fix callback-return issues (#8996) 2020-07-17 20:19:52 -02:30
background.js Use eslint@6.8.0 (#8978) 2020-07-14 12:50:41 -02:30
chromereload.js Fix console.error references 2016-08-29 17:32:39 -07:00
contentscript.js Use eslint@6.8.0 (#8978) 2020-07-14 12:50:41 -02:30
first-time-state.js Migrate codebase to use ESM (#7730) 2020-01-09 00:04:58 -03:30
inpage.js Define global web3 as non-enumerable (#8634) 2020-05-20 20:18:25 -07:00
metamask-controller.js Change MetaMetrics category for background events (#9155) 2020-08-07 13:45:49 -03:00
phishing-detect.js blacklist -> blocklist; whitelist -> safelist 2020-06-08 17:49:36 -07:00
ui.js Restore state snapshot for Sentry errors (#9028) 2020-07-17 12:09:38 -03:00