Skip to content

Commit

Permalink
Bug 1720171 - Ensure ga.getAll().filter exists in SmartBlock Google A…
Browse files Browse the repository at this point in the history
…nalytics shim. r=twisniewski,webcompat-reviewers a=pascalc

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
  • Loading branch information
staktrace committed Jul 13, 2021
1 parent a716133 commit d423a2c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion browser/extensions/webcompat/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit d423a2c

Please sign in to comment.