Bug 1720171 - Ensure ga.getAll().filter exists in SmartBlock Google Analytics shim. r=twisniewski,webcompat-reviewers

The original GA code returns an Array for ga.getAll(), while the
shim was returning an Iterator. This caused code that relied on
ga.getAll().filter(..) to break with the shim. This patch wraps
the Iterator contents back into an Array.

Differential Revision: https://phabricator.services.mozilla.com/D119737
This commit is contained in:
Kartikaya Gupta
2021-07-13 16:44:42 +00:00
parent 48de72fff7
commit 6ec49e1375
2 changed files with 2 additions and 2 deletions

View File

@@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "Web Compatibility Interventions",
"description": "Urgent post-release fixes for web compatibility.",
"version": "24.1.0",
"version": "24.2.0",
"applications": {
"gecko": {

View File

@@ -140,7 +140,7 @@ if (window[window.GoogleAnalyticsObject || "ga"]?.loaded === undefined) {
Object.assign(ga, {
create: (a, b, c, d) => ga("create", a, b, c, d),
getAll: () => trackers.values(),
getAll: () => Array.from(trackers.values()),
getByName: name => trackers.get(name),
loaded: true,
remove: t => ga("remove", t),