From 172d2b2de9caa621a39a41e14a405d4fb4c158b8 Mon Sep 17 00:00:00 2001 From: Thomas Wisniewski Date: Wed, 14 Jul 2021 14:26:26 +0000 Subject: [PATCH] Bug 1713699 - Add a SmartBlock shim for Chartbeat Superfly; r=ksenia,webcompat-reviewers Differential Revision: https://phabricator.services.mozilla.com/D119883 --- browser/extensions/webcompat/data/shims.js | 12 ++++++++++++ browser/extensions/webcompat/manifest.json | 3 ++- browser/extensions/webcompat/moz.build | 1 + .../extensions/webcompat/shims/chartbeat.js | 18 ++++++++++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 browser/extensions/webcompat/shims/chartbeat.js diff --git a/browser/extensions/webcompat/data/shims.js b/browser/extensions/webcompat/data/shims.js index bb9cbd7cf47f..c4c9319978c2 100644 --- a/browser/extensions/webcompat/data/shims.js +++ b/browser/extensions/webcompat/data/shims.js @@ -125,6 +125,18 @@ const AVAILABLE_SHIMS = [ matches: ["*://auth.9c9media.ca/auth/main.js"], onlyIfBlockedByETP: true, }, + { + id: "Chartbeat", + platform: "all", + name: "Chartbeat", + bug: "1713699", + file: "chartbeat.js", + matches: [ + "*://static.chartbeat.com/js/chartbeat.js", + "*://static.chartbeat.com/js/chartbeat_video.js", + ], + onlyIfBlockedByETP: true, + }, { id: "Doubleclick", platform: "all", diff --git a/browser/extensions/webcompat/manifest.json b/browser/extensions/webcompat/manifest.json index 839fb382a5c0..912825d2f51e 100644 --- a/browser/extensions/webcompat/manifest.json +++ b/browser/extensions/webcompat/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "Web Compatibility Interventions", "description": "Urgent post-release fixes for web compatibility.", - "version": "24.2.0", + "version": "24.3.0", "applications": { "gecko": { @@ -92,6 +92,7 @@ "web_accessible_resources": [ "shims/adsafeprotected-ima.js", "shims/bmauth.js", + "shims/chartbeat.js", "shims/eluminate.js", "shims/empty-script.js", "shims/empty-shim.txt", diff --git a/browser/extensions/webcompat/moz.build b/browser/extensions/webcompat/moz.build index 6a9bf79045ef..4052df5bacf4 100644 --- a/browser/extensions/webcompat/moz.build +++ b/browser/extensions/webcompat/moz.build @@ -81,6 +81,7 @@ FINAL_TARGET_FILES.features["webcompat@mozilla.org"]["injections"]["js"] += [ FINAL_TARGET_FILES.features["webcompat@mozilla.org"]["shims"] += [ "shims/adsafeprotected-ima.js", "shims/bmauth.js", + "shims/chartbeat.js", "shims/eluminate.js", "shims/empty-script.js", "shims/empty-shim.txt", diff --git a/browser/extensions/webcompat/shims/chartbeat.js b/browser/extensions/webcompat/shims/chartbeat.js new file mode 100644 index 000000000000..0e57fc6da197 --- /dev/null +++ b/browser/extensions/webcompat/shims/chartbeat.js @@ -0,0 +1,18 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +/** + * Bug 1713699 - Shim ChartBeat tracking + * + * Sites may rely on chartbeat's tracking as they might with Google Analytics, + * expecting it to be present for interactive site content to function. This + * shim mitigates related breakage. + */ + +window.pSUPERFLY = { + activity() {}, + virtualPage() {}, +};