From 230ed0349b7d235b2aea7aa876ca01e49b8ef73f Mon Sep 17 00:00:00 2001 From: errorlifeisnull <120217293+errorlifeisnull@users.noreply.github.com> Date: Fri, 9 Dec 2022 11:51:12 -0800 Subject: [PATCH 01/14] Fixing bestiefy.com --- src/data/surrogates.js | 154 +++++++++++++++++------------------------ 1 file changed, 62 insertions(+), 92 deletions(-) diff --git a/src/data/surrogates.js b/src/data/surrogates.js index 54ca250d3b..abfdb740ba 100644 --- a/src/data/surrogates.js +++ b/src/data/surrogates.js @@ -15,123 +15,91 @@ * along with Privacy Badger. If not, see . */ -const MATCH_SUFFIX = 'suffix', - MATCH_PREFIX = 'prefix', - MATCH_PREFIX_WITH_PARAMS = 'prefix_params', - MATCH_ANY = 'any'; +const MATCH_SUFFIX = "suffix", + MATCH_PREFIX = "prefix", + MATCH_PREFIX_WITH_PARAMS = "prefix_params", + MATCH_ANY = "any"; /** * `hostnames` maps hostnames to surrogate pattern tokens. */ const hostnames = { - 'b.scorecardresearch.com': { + "b.scorecardresearch.com": { match: MATCH_SUFFIX, - tokens: [ - '/beacon.js', - '/c2/plugins/streamsense_plugin_html5.js', - ] + tokens: ["/beacon.js", "/c2/plugins/streamsense_plugin_html5.js"], }, - 'sb.scorecardresearch.com': { + "sb.scorecardresearch.com": { match: MATCH_SUFFIX, - tokens: [ - '/beacon.js', - '/c2/plugins/streamsense_plugin_html5.js', - ] + tokens: ["/beacon.js", "/c2/plugins/streamsense_plugin_html5.js"], }, - 'ssl.google-analytics.com': { + "ssl.google-analytics.com": { match: MATCH_SUFFIX, - tokens: [ - '/ga.js', - '/analytics.js', - ] + tokens: ["/ga.js", "/analytics.js"], }, - 'www.google-analytics.com': { + "www.google-analytics.com": { match: MATCH_SUFFIX, - tokens: [ - '/analytics.js', - '/ga.js', - ] + tokens: ["/analytics.js", "/ga.js"], }, - 'www.googletagservices.com': { + "www.googletagservices.com": { match: MATCH_SUFFIX, - tokens: [ - '/gpt.js', - ] + tokens: ["/gpt.js"], }, - 'securepubads.g.doubleclick.net': { + "securepubads.g.doubleclick.net": { match: MATCH_SUFFIX, - tokens: [ - '/tag/js/gpt.js', - ] + tokens: ["/tag/js/gpt.js"], }, - 'pagead2.googlesyndication.com': { + "pagead2.googlesyndication.com": { match: MATCH_SUFFIX, - tokens: [ - '/tag/js/gpt.js', - '/omweb-v1.js', - ] + tokens: ["/tag/js/gpt.js", "/omweb-v1.js"], }, - 'api.youneeq.ca': { + "api.youneeq.ca": { match: MATCH_SUFFIX, - tokens: [ - '/app/yqmin', - ] + tokens: ["/app/yqmin"], }, - 'cdn.krxd.net': { + "cdn.krxd.net": { match: MATCH_ANY, - token: 'noopjs' + token: "noopjs", }, - 'widgets.outbrain.com': { + "widgets.outbrain.com": { match: MATCH_SUFFIX, - tokens: [ - '/outbrain.js', - ] + tokens: ["/outbrain.js"], }, - 'c.amazon-adsystem.com': { + "c.amazon-adsystem.com": { match: MATCH_SUFFIX, - tokens: [ - '/apstag.js', - ] + tokens: ["/apstag.js"], }, - 'rumble.com': { + "rumble.com": { match: MATCH_PREFIX, - tokens: [ - '/embedJS/', - ], - widgetName: "Rumble Video Player" + tokens: ["/embedJS/"], + widgetName: "Rumble Video Player", }, - 'www.google.com': { + "www.google.com": { match: MATCH_PREFIX_WITH_PARAMS, params: { onload: true, //render: "explicit", render: true, }, - tokens: [ - '/recaptcha/api.js', - '/recaptcha/enterprise.js', - ], - widgetName: "Google reCAPTCHA" + tokens: ["/recaptcha/api.js", "/recaptcha/enterprise.js"], + widgetName: "Google reCAPTCHA", }, - 'www.recaptcha.net': { + "www.recaptcha.net": { match: MATCH_PREFIX_WITH_PARAMS, params: { onload: true, render: true, }, - tokens: [ - '/recaptcha/api.js', - '/recaptcha/enterprise.js', - ], - widgetName: "Google reCAPTCHA" + tokens: ["/recaptcha/api.js", "/recaptcha/enterprise.js"], + widgetName: "Google reCAPTCHA", }, - 'www.youtube.com': { + "www.youtube.com": { match: MATCH_PREFIX, - tokens: [ - '/iframe_api', - '/player_api', - ], - widgetName: "YouTube" + tokens: ["/iframe_api", "/player_api"], + widgetName: "YouTube", + }, + "cdn.intergient.com": { + match: MATCH_SUFFIX, + tokens: ["/ramp_core.js"], }, }; @@ -148,42 +116,44 @@ const surrogates = { // // API reference: // https://developers.google.com/analytics/devguides/collection/gajs/methods/ - '/ga.js': 'google_ga.js', + "/ga.js": "google_ga.js", - '/beacon.js': 'comscore_beacon.js', + "/beacon.js": "comscore_beacon.js", // http://www.dplay.se/ett-jobb-for-berg/ (videos) - '/c2/plugins/streamsense_plugin_html5.js': 'noop.js', + "/c2/plugins/streamsense_plugin_html5.js": "noop.js", // https://github.com/EFForg/privacybadger/issues/993 - '/gpt.js': 'googletagservices_gpt.js', - '/tag/js/gpt.js': 'googletagservices_gpt.js', + "/gpt.js": "googletagservices_gpt.js", + "/tag/js/gpt.js": "googletagservices_gpt.js", // https://github.com/EFForg/privacybadger/issues/1014 - '/app/yqmin': 'youneeq.js', + "/app/yqmin": "youneeq.js", - '/analytics.js': 'google_analytics.js', + "/analytics.js": "google_analytics.js", - '/outbrain.js': 'outbrain.js', + "/outbrain.js": "outbrain.js", - '/apstag.js': 'amazon_apstag.js', + "/apstag.js": "amazon_apstag.js", - '/embedJS/': 'rumble_embedjs.js', + "/embedJS/": "rumble_embedjs.js", - '/recaptcha/api.js': 'grecaptcha.js', - '/recaptcha/enterprise.js': 'grecaptcha_enterprise.js', + "/recaptcha/api.js": "grecaptcha.js", + "/recaptcha/enterprise.js": "grecaptcha_enterprise.js", - '/iframe_api': 'youtube.js', - '/player_api': 'youtube.js', + "/iframe_api": "youtube.js", + "/player_api": "youtube.js", - '/omweb-v1.js': 'noop.js', + "/omweb-v1.js": "noop.js", + + "/ramp_core.js": "noop.js", - 'noopjs': 'noop.js' + noopjs: "noop.js", }; // expand filenames to extension URLs -Object.keys(surrogates).forEach(key => { - let path = '/data/web_accessible_resources/' + surrogates[key]; +Object.keys(surrogates).forEach((key) => { + let path = "/data/web_accessible_resources/" + surrogates[key]; surrogates[key] = chrome.runtime.getURL(path); }); From e90bbf6506b3eac672e0849034981284679318be Mon Sep 17 00:00:00 2001 From: errorlifeisnull <120217293+errorlifeisnull@users.noreply.github.com> Date: Fri, 9 Dec 2022 12:03:22 -0800 Subject: [PATCH 02/14] Fixing bestiefy.com --- src/data/web_accessible_resources/ramp.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/data/web_accessible_resources/ramp.js diff --git a/src/data/web_accessible_resources/ramp.js b/src/data/web_accessible_resources/ramp.js new file mode 100644 index 0000000000..d758694bf6 --- /dev/null +++ b/src/data/web_accessible_resources/ramp.js @@ -0,0 +1,23 @@ +window.ramp = { + addUnits: function () { + return; + }, + destroyUnits: function () { + return; + }, + displayUnits: function () { + return; + }, +}; + +window.tyche = { + addUnits: function () { + return; + }, + destroyUnits: function () { + return; + }, + displayUnits: function () { + return; + }, +}; From 4e2aad5369350837c380d3a7c643f3c736323126 Mon Sep 17 00:00:00 2001 From: errorlifeisnull <120217293+errorlifeisnull@users.noreply.github.com> Date: Fri, 9 Dec 2022 12:05:09 -0800 Subject: [PATCH 03/14] Fixing bestiefy.com --- src/data/surrogates.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/data/surrogates.js b/src/data/surrogates.js index abfdb740ba..0f67306d94 100644 --- a/src/data/surrogates.js +++ b/src/data/surrogates.js @@ -101,6 +101,10 @@ const hostnames = { match: MATCH_SUFFIX, tokens: ["/ramp_core.js"], }, + "fingerprinter-production.herokuapp.com": { + match: MATCH_SUFFIX, + tokens: ["/audience_segments"], + }, }; /** @@ -146,7 +150,9 @@ const surrogates = { "/omweb-v1.js": "noop.js", - "/ramp_core.js": "noop.js", + "/ramp_core.js": "ramp.js", + + "/audience_segments": "audience_segments" noopjs: "noop.js", }; From 865af464f25368c3531072a4d74efd7a0d3ca310 Mon Sep 17 00:00:00 2001 From: errorlifeisnull <120217293+errorlifeisnull@users.noreply.github.com> Date: Fri, 9 Dec 2022 12:05:21 -0800 Subject: [PATCH 04/14] Fixing bestiefy.com --- src/data/surrogates.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/surrogates.js b/src/data/surrogates.js index 0f67306d94..6fb4ce6453 100644 --- a/src/data/surrogates.js +++ b/src/data/surrogates.js @@ -103,7 +103,7 @@ const hostnames = { }, "fingerprinter-production.herokuapp.com": { match: MATCH_SUFFIX, - tokens: ["/audience_segments"], + tokens: ["/audience_segments.txt"], }, }; From 564d83526ae46cc15d502760ad600876decb49f7 Mon Sep 17 00:00:00 2001 From: errorlifeisnull <120217293+errorlifeisnull@users.noreply.github.com> Date: Fri, 9 Dec 2022 12:06:33 -0800 Subject: [PATCH 05/14] Create audience_segments.json --- src/data/audience_segments.json | 49 +++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/data/audience_segments.json diff --git a/src/data/audience_segments.json b/src/data/audience_segments.json new file mode 100644 index 0000000000..39c2306a62 --- /dev/null +++ b/src/data/audience_segments.json @@ -0,0 +1,49 @@ +{ + "audience_segments": [ + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4", + "4" + ] +} From 611b49fc49b50ae53bc8bae646ed5cecb2a24bfc Mon Sep 17 00:00:00 2001 From: errorlifeisnull <120217293+errorlifeisnull@users.noreply.github.com> Date: Fri, 9 Dec 2022 12:06:50 -0800 Subject: [PATCH 06/14] Fix file name --- src/data/surrogates.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/surrogates.js b/src/data/surrogates.js index 6fb4ce6453..c3aff4e525 100644 --- a/src/data/surrogates.js +++ b/src/data/surrogates.js @@ -152,7 +152,7 @@ const surrogates = { "/ramp_core.js": "ramp.js", - "/audience_segments": "audience_segments" + "/audience_segments": "audience_segments.json" noopjs: "noop.js", }; From 1111924ac3a1ed33a6dd586bec8d1187d8608b11 Mon Sep 17 00:00:00 2001 From: errorlifeisnull <120217293+errorlifeisnull@users.noreply.github.com> Date: Fri, 9 Dec 2022 12:07:47 -0800 Subject: [PATCH 07/14] Fix matching for bestiefy.com --- src/data/surrogates.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/surrogates.js b/src/data/surrogates.js index c3aff4e525..f03dfc1e26 100644 --- a/src/data/surrogates.js +++ b/src/data/surrogates.js @@ -103,7 +103,7 @@ const hostnames = { }, "fingerprinter-production.herokuapp.com": { match: MATCH_SUFFIX, - tokens: ["/audience_segments.txt"], + tokens: ["/audience_segments"], }, }; From cc3931d27c9132fc37530b04227d04f100f747ce Mon Sep 17 00:00:00 2001 From: errorlifeisnull <120217293+errorlifeisnull@users.noreply.github.com> Date: Fri, 9 Dec 2022 12:09:05 -0800 Subject: [PATCH 08/14] Moving file, changing data --- src/data/audience_segments.json | 49 ------------------- .../audience_segments.json | 3 ++ 2 files changed, 3 insertions(+), 49 deletions(-) delete mode 100644 src/data/audience_segments.json create mode 100644 src/data/web_accessible_resources/audience_segments.json diff --git a/src/data/audience_segments.json b/src/data/audience_segments.json deleted file mode 100644 index 39c2306a62..0000000000 --- a/src/data/audience_segments.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "audience_segments": [ - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4", - "4" - ] -} diff --git a/src/data/web_accessible_resources/audience_segments.json b/src/data/web_accessible_resources/audience_segments.json new file mode 100644 index 0000000000..c4dd899983 --- /dev/null +++ b/src/data/web_accessible_resources/audience_segments.json @@ -0,0 +1,3 @@ +{ + "audience_segments": [] +} From ea3723c2aff31d5f44b993f17e43cd6ac6010883 Mon Sep 17 00:00:00 2001 From: errorlifeisnull <120217293+errorlifeisnull@users.noreply.github.com> Date: Mon, 19 Dec 2022 13:31:48 -0800 Subject: [PATCH 09/14] Trying to fix the formatting here --- src/data/surrogates.js | 124 ++++++++++++++++++++--------------------- 1 file changed, 61 insertions(+), 63 deletions(-) diff --git a/src/data/surrogates.js b/src/data/surrogates.js index f03dfc1e26..06e922f75a 100644 --- a/src/data/surrogates.js +++ b/src/data/surrogates.js @@ -15,95 +15,95 @@ * along with Privacy Badger. If not, see . */ -const MATCH_SUFFIX = "suffix", - MATCH_PREFIX = "prefix", - MATCH_PREFIX_WITH_PARAMS = "prefix_params", - MATCH_ANY = "any"; +const MATCH_SUFFIX = 'suffix', + MATCH_PREFIX = 'prefix', + MATCH_PREFIX_WITH_PARAMS = 'prefix_params', + MATCH_ANY = 'any'; /** * `hostnames` maps hostnames to surrogate pattern tokens. */ const hostnames = { - "b.scorecardresearch.com": { + 'b.scorecardresearch.com': { match: MATCH_SUFFIX, - tokens: ["/beacon.js", "/c2/plugins/streamsense_plugin_html5.js"], + tokens: ['/beacon.js', '/c2/plugins/streamsense_plugin_html5.js'], }, - "sb.scorecardresearch.com": { + 'sb.scorecardresearch.com': { match: MATCH_SUFFIX, - tokens: ["/beacon.js", "/c2/plugins/streamsense_plugin_html5.js"], + tokens: ['/beacon.js', '/c2/plugins/streamsense_plugin_html5.js'], }, - "ssl.google-analytics.com": { + 'ssl.google-analytics.com': { match: MATCH_SUFFIX, - tokens: ["/ga.js", "/analytics.js"], + tokens: ['/ga.js', '/analytics.js'], }, - "www.google-analytics.com": { + 'www.google-analytics.com': { match: MATCH_SUFFIX, - tokens: ["/analytics.js", "/ga.js"], + tokens: ['/analytics.js', '/ga.js'], }, - "www.googletagservices.com": { + 'www.googletagservices.com': { match: MATCH_SUFFIX, - tokens: ["/gpt.js"], + tokens: ['/gpt.js'], }, - "securepubads.g.doubleclick.net": { + 'securepubads.g.doubleclick.net': { match: MATCH_SUFFIX, - tokens: ["/tag/js/gpt.js"], + tokens: ['/tag/js/gpt.js'], }, - "pagead2.googlesyndication.com": { + 'pagead2.googlesyndication.com': { match: MATCH_SUFFIX, - tokens: ["/tag/js/gpt.js", "/omweb-v1.js"], + tokens: ['/tag/js/gpt.js', '/omweb-v1.js'], }, - "api.youneeq.ca": { + 'api.youneeq.ca': { match: MATCH_SUFFIX, - tokens: ["/app/yqmin"], + tokens: ['/app/yqmin'], }, - "cdn.krxd.net": { + 'cdn.krxd.net': { match: MATCH_ANY, - token: "noopjs", + token: 'noopjs', }, - "widgets.outbrain.com": { + 'widgets.outbrain.com': { match: MATCH_SUFFIX, - tokens: ["/outbrain.js"], + tokens: ['/outbrain.js'], }, - "c.amazon-adsystem.com": { + 'c.amazon-adsystem.com': { match: MATCH_SUFFIX, - tokens: ["/apstag.js"], + tokens: ['/apstag.js'], }, - "rumble.com": { + 'rumble.com': { match: MATCH_PREFIX, - tokens: ["/embedJS/"], - widgetName: "Rumble Video Player", + tokens: ['/embedJS/'], + widgetName: 'Rumble Video Player', }, - "www.google.com": { + 'www.google.com': { match: MATCH_PREFIX_WITH_PARAMS, params: { onload: true, - //render: "explicit", + //render: 'explicit', render: true, }, - tokens: ["/recaptcha/api.js", "/recaptcha/enterprise.js"], - widgetName: "Google reCAPTCHA", + tokens: ['/recaptcha/api.js', '/recaptcha/enterprise.js'], + widgetName: 'Google reCAPTCHA', }, - "www.recaptcha.net": { + 'www.recaptcha.net': { match: MATCH_PREFIX_WITH_PARAMS, params: { onload: true, render: true, }, - tokens: ["/recaptcha/api.js", "/recaptcha/enterprise.js"], - widgetName: "Google reCAPTCHA", + tokens: ['/recaptcha/api.js', '/recaptcha/enterprise.js'], + widgetName: 'Google reCAPTCHA', }, - "www.youtube.com": { + 'www.youtube.com': { match: MATCH_PREFIX, - tokens: ["/iframe_api", "/player_api"], - widgetName: "YouTube", + tokens: ['/iframe_api', '/player_api'], + widgetName: 'YouTube', }, - "cdn.intergient.com": { + 'cdn.intergient.com': { match: MATCH_SUFFIX, - tokens: ["/ramp_core.js"], + tokens: ['/ramp_core.js'], }, - "fingerprinter-production.herokuapp.com": { + 'fingerprinter-production.herokuapp.com': { match: MATCH_SUFFIX, - tokens: ["/audience_segments"], + tokens: ['/audience_segments'], }, }; @@ -120,46 +120,44 @@ const surrogates = { // // API reference: // https://developers.google.com/analytics/devguides/collection/gajs/methods/ - "/ga.js": "google_ga.js", + '/ga.js': 'google_ga.js', - "/beacon.js": "comscore_beacon.js", + '/beacon.js': 'comscore_beacon.js', // http://www.dplay.se/ett-jobb-for-berg/ (videos) - "/c2/plugins/streamsense_plugin_html5.js": "noop.js", + '/c2/plugins/streamsense_plugin_html5.js': 'noop.js', // https://github.com/EFForg/privacybadger/issues/993 - "/gpt.js": "googletagservices_gpt.js", - "/tag/js/gpt.js": "googletagservices_gpt.js", + '/gpt.js': 'googletagservices_gpt.js', + '/tag/js/gpt.js': 'googletagservices_gpt.js', // https://github.com/EFForg/privacybadger/issues/1014 - "/app/yqmin": "youneeq.js", + '/app/yqmin': 'youneeq.js', - "/analytics.js": "google_analytics.js", + '/analytics.js': 'google_analytics.js', - "/outbrain.js": "outbrain.js", + '/outbrain.js': 'outbrain.js', - "/apstag.js": "amazon_apstag.js", + '/apstag.js': 'amazon_apstag.js', - "/embedJS/": "rumble_embedjs.js", + '/embedJS/': 'rumble_embedjs.js', - "/recaptcha/api.js": "grecaptcha.js", - "/recaptcha/enterprise.js": "grecaptcha_enterprise.js", + '/recaptcha/api.js': 'grecaptcha.js', + '/recaptcha/enterprise.js': 'grecaptcha_enterprise.js', - "/iframe_api": "youtube.js", - "/player_api": "youtube.js", + '/iframe_api': 'youtube.js', + '/player_api': 'youtube.js', - "/omweb-v1.js": "noop.js", + '/omweb-v1.js': 'noop.js', - "/ramp_core.js": "ramp.js", - - "/audience_segments": "audience_segments.json" + '/ramp_core.js': 'ramp.js', - noopjs: "noop.js", + 'noopjs': 'noop.js', }; // expand filenames to extension URLs Object.keys(surrogates).forEach((key) => { - let path = "/data/web_accessible_resources/" + surrogates[key]; + let path = '/data/web_accessible_resources/' + surrogates[key]; surrogates[key] = chrome.runtime.getURL(path); }); From 385466af483afdf7e18e95b8cca6403cd14734c9 Mon Sep 17 00:00:00 2001 From: errorlifeisnull <120217293+errorlifeisnull@users.noreply.github.com> Date: Mon, 19 Dec 2022 13:33:29 -0800 Subject: [PATCH 10/14] rm fingerprinter-production.herokuapp.com Privacy Badger hasn't detected this as a fingerprinter yet, and I'm still not 100% sure what it does exactly --- src/data/surrogates.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/data/surrogates.js b/src/data/surrogates.js index 06e922f75a..b26228befb 100644 --- a/src/data/surrogates.js +++ b/src/data/surrogates.js @@ -100,11 +100,7 @@ const hostnames = { 'cdn.intergient.com': { match: MATCH_SUFFIX, tokens: ['/ramp_core.js'], - }, - 'fingerprinter-production.herokuapp.com': { - match: MATCH_SUFFIX, - tokens: ['/audience_segments'], - }, + } }; /** From 7ab7f8d750714195b09d85ad804b4e2d85ae7ca5 Mon Sep 17 00:00:00 2001 From: errorlifeisnull <120217293+errorlifeisnull@users.noreply.github.com> Date: Mon, 19 Dec 2022 13:34:01 -0800 Subject: [PATCH 11/14] This does not unbreak as far as I can tell --- src/data/web_accessible_resources/audience_segments.json | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 src/data/web_accessible_resources/audience_segments.json diff --git a/src/data/web_accessible_resources/audience_segments.json b/src/data/web_accessible_resources/audience_segments.json deleted file mode 100644 index c4dd899983..0000000000 --- a/src/data/web_accessible_resources/audience_segments.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "audience_segments": [] -} From 2fed2b1c471f9107f227a6499d0082f5332196be Mon Sep 17 00:00:00 2001 From: errorlifeisnull <120217293+errorlifeisnull@users.noreply.github.com> Date: Mon, 19 Dec 2022 13:35:34 -0800 Subject: [PATCH 12/14] update ramp to fix better https://github.com/EFForg/privacybadger/pull/2865#issuecomment-1355151256 --- src/data/web_accessible_resources/ramp.js | 40 ++++++++++------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/src/data/web_accessible_resources/ramp.js b/src/data/web_accessible_resources/ramp.js index d758694bf6..dbe873d660 100644 --- a/src/data/web_accessible_resources/ramp.js +++ b/src/data/web_accessible_resources/ramp.js @@ -1,23 +1,17 @@ -window.ramp = { - addUnits: function () { - return; - }, - destroyUnits: function () { - return; - }, - displayUnits: function () { - return; - }, -}; - -window.tyche = { - addUnits: function () { - return; - }, - destroyUnits: function () { - return; - }, - displayUnits: function () { - return; - }, -}; +// https://developers.playwire.com/api/docs/ads/getting-started-ads.html +// https://github.com/EFForg/privacybadger/pull/2865#issuecomment-1355151256 +(function () { + function noopfn() {} + function checkForOnReady() { + if (!window.ramp) { + window.ramp = {}; + } + window.ramp.addUnits = () => new Promise(noopfn); + window.ramp.displayUnits = noopfn; + window.ramp.destroyUnits = noopfn; + if (typeof window.ramp.onReady == "function") { + window.ramp.onReady(); + } + } + setTimeout(checkForOnReady, 10); +})(); From da3af662c57d6035a4bea40fd9c99a6b6756cb05 Mon Sep 17 00:00:00 2001 From: errorlifeisnull <120217293+errorlifeisnull@users.noreply.github.com> Date: Mon, 19 Dec 2022 13:36:45 -0800 Subject: [PATCH 13/14] pull/2865#issuecomment-1355151256 --- src/data/surrogates.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/surrogates.js b/src/data/surrogates.js index b26228befb..c81ddeb5cd 100644 --- a/src/data/surrogates.js +++ b/src/data/surrogates.js @@ -99,7 +99,7 @@ const hostnames = { }, 'cdn.intergient.com': { match: MATCH_SUFFIX, - tokens: ['/ramp_core.js'], + tokens: ['/ramp.js'], } }; @@ -146,7 +146,7 @@ const surrogates = { '/omweb-v1.js': 'noop.js', - '/ramp_core.js': 'ramp.js', + '/ramp.js': 'ramp.js', 'noopjs': 'noop.js', }; From 3328da3386be9c62860c5499d89df002aca347da Mon Sep 17 00:00:00 2001 From: errorlifeisnull <120217293+errorlifeisnull@users.noreply.github.com> Date: Mon, 19 Dec 2022 13:51:52 -0800 Subject: [PATCH 14/14] Fixing problems caused by Prettier --- src/data/surrogates.js | 86 ++++++++++++++++++++++++++++++------------ 1 file changed, 61 insertions(+), 25 deletions(-) diff --git a/src/data/surrogates.js b/src/data/surrogates.js index c81ddeb5cd..814457d4be 100644 --- a/src/data/surrogates.js +++ b/src/data/surrogates.js @@ -26,62 +26,92 @@ const MATCH_SUFFIX = 'suffix', const hostnames = { 'b.scorecardresearch.com': { match: MATCH_SUFFIX, - tokens: ['/beacon.js', '/c2/plugins/streamsense_plugin_html5.js'], + tokens: [ + '/beacon.js', + '/c2/plugins/streamsense_plugin_html5.js', + ] }, 'sb.scorecardresearch.com': { match: MATCH_SUFFIX, - tokens: ['/beacon.js', '/c2/plugins/streamsense_plugin_html5.js'], + tokens: [ + '/beacon.js', + '/c2/plugins/streamsense_plugin_html5.js', + ] }, 'ssl.google-analytics.com': { match: MATCH_SUFFIX, - tokens: ['/ga.js', '/analytics.js'], + tokens: [ + '/ga.js', + '/analytics.js', + ] }, 'www.google-analytics.com': { match: MATCH_SUFFIX, - tokens: ['/analytics.js', '/ga.js'], + tokens: [ + '/analytics.js', + '/ga.js', + ] }, 'www.googletagservices.com': { match: MATCH_SUFFIX, - tokens: ['/gpt.js'], + tokens: [ + '/gpt.js', + ] }, 'securepubads.g.doubleclick.net': { match: MATCH_SUFFIX, - tokens: ['/tag/js/gpt.js'], + tokens: [ + '/tag/js/gpt.js', + ] }, 'pagead2.googlesyndication.com': { match: MATCH_SUFFIX, - tokens: ['/tag/js/gpt.js', '/omweb-v1.js'], + tokens: [ + '/tag/js/gpt.js', + '/omweb-v1.js', + ] }, 'api.youneeq.ca': { match: MATCH_SUFFIX, - tokens: ['/app/yqmin'], + tokens: [ + '/app/yqmin', + ] }, 'cdn.krxd.net': { match: MATCH_ANY, - token: 'noopjs', + token: 'noopjs' }, 'widgets.outbrain.com': { match: MATCH_SUFFIX, - tokens: ['/outbrain.js'], + tokens: [ + '/outbrain.js', + ] }, 'c.amazon-adsystem.com': { match: MATCH_SUFFIX, - tokens: ['/apstag.js'], + tokens: [ + '/apstag.js', + ] }, 'rumble.com': { match: MATCH_PREFIX, - tokens: ['/embedJS/'], - widgetName: 'Rumble Video Player', + tokens: [ + '/embedJS/', + ], + widgetName: "Rumble Video Player" }, 'www.google.com': { match: MATCH_PREFIX_WITH_PARAMS, params: { onload: true, - //render: 'explicit', + //render: "explicit", render: true, }, - tokens: ['/recaptcha/api.js', '/recaptcha/enterprise.js'], - widgetName: 'Google reCAPTCHA', + tokens: [ + '/recaptcha/api.js', + '/recaptcha/enterprise.js', + ], + widgetName: "Google reCAPTCHA" }, 'www.recaptcha.net': { match: MATCH_PREFIX_WITH_PARAMS, @@ -89,17 +119,23 @@ const hostnames = { onload: true, render: true, }, - tokens: ['/recaptcha/api.js', '/recaptcha/enterprise.js'], - widgetName: 'Google reCAPTCHA', + tokens: [ + '/recaptcha/api.js', + '/recaptcha/enterprise.js', + ], + widgetName: "Google reCAPTCHA" }, 'www.youtube.com': { match: MATCH_PREFIX, - tokens: ['/iframe_api', '/player_api'], - widgetName: 'YouTube', + tokens: [ + '/iframe_api', + '/player_api', + ], + widgetName: "YouTube" }, 'cdn.intergient.com': { match: MATCH_SUFFIX, - tokens: ['/ramp.js'], + tokens: ['/ramp_core.js'], } }; @@ -146,13 +182,13 @@ const surrogates = { '/omweb-v1.js': 'noop.js', - '/ramp.js': 'ramp.js', + '/ramp_core.js': 'ramp.js', - 'noopjs': 'noop.js', + 'noopjs': 'noop.js' }; // expand filenames to extension URLs -Object.keys(surrogates).forEach((key) => { +Object.keys(surrogates).forEach(key => { let path = '/data/web_accessible_resources/' + surrogates[key]; surrogates[key] = chrome.runtime.getURL(path); }); @@ -164,4 +200,4 @@ export default { MATCH_SUFFIX, hostnames, surrogates, -}; +}; \ No newline at end of file