summaryrefslogtreecommitdiffstats
path: root/src/web_accessible_resources
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 05:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 05:47:55 +0000
commit31d6ff6f931696850c348007241195ab3b2eddc7 (patch)
tree615cb1c57ce9f6611bad93326b9105098f379609 /src/web_accessible_resources
parentInitial commit. (diff)
downloadublock-origin-31d6ff6f931696850c348007241195ab3b2eddc7.tar.xz
ublock-origin-31d6ff6f931696850c348007241195ab3b2eddc7.zip
Adding upstream version 1.55.0+dfsg.upstream/1.55.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/web_accessible_resources')
-rw-r--r--src/web_accessible_resources/1x1.gifbin0 -> 43 bytes
-rw-r--r--src/web_accessible_resources/2x2.pngbin0 -> 68 bytes
-rw-r--r--src/web_accessible_resources/32x32.pngbin0 -> 83 bytes
-rw-r--r--src/web_accessible_resources/3x2.pngbin0 -> 68 bytes
-rw-r--r--src/web_accessible_resources/README.txt11
-rw-r--r--src/web_accessible_resources/amazon_ads.js70
-rw-r--r--src/web_accessible_resources/amazon_apstag.js62
-rw-r--r--src/web_accessible_resources/ampproject_v0.js34
-rw-r--r--src/web_accessible_resources/chartbeat.js30
-rw-r--r--src/web_accessible_resources/click2load.html28
-rw-r--r--src/web_accessible_resources/dom-inspector.html25
-rw-r--r--src/web_accessible_resources/doubleclick_instream_ad_status.js1
-rw-r--r--src/web_accessible_resources/empty0
-rw-r--r--src/web_accessible_resources/epicker-ui.html75
-rw-r--r--src/web_accessible_resources/fingerprint2.js55
-rw-r--r--src/web_accessible_resources/fingerprint3.js45
-rw-r--r--src/web_accessible_resources/google-analytics_analytics.js110
-rw-r--r--src/web_accessible_resources/google-analytics_cx_api.js36
-rw-r--r--src/web_accessible_resources/google-analytics_ga.js130
-rw-r--r--src/web_accessible_resources/google-analytics_inpage_linkid.js28
-rw-r--r--src/web_accessible_resources/google-ima.js855
-rw-r--r--src/web_accessible_resources/googlesyndication_adsbygoogle.js56
-rw-r--r--src/web_accessible_resources/googletagmanager_gtm.js43
-rw-r--r--src/web_accessible_resources/googletagservices_gpt.js154
-rw-r--r--src/web_accessible_resources/hd-main.js46
-rw-r--r--src/web_accessible_resources/nobab.js87
-rw-r--r--src/web_accessible_resources/nobab2.js42
-rw-r--r--src/web_accessible_resources/noeval-silent.js28
-rw-r--r--src/web_accessible_resources/noeval.js30
-rw-r--r--src/web_accessible_resources/nofab.js67
-rw-r--r--src/web_accessible_resources/noop-0.1s.mp3bin0 -> 813 bytes
-rw-r--r--src/web_accessible_resources/noop-0.5s.mp3bin0 -> 2349 bytes
-rw-r--r--src/web_accessible_resources/noop-1s.mp4bin0 -> 3753 bytes
-rw-r--r--src/web_accessible_resources/noop-vmap1.0.xml1
-rw-r--r--src/web_accessible_resources/noop.css1
-rw-r--r--src/web_accessible_resources/noop.html5
-rw-r--r--src/web_accessible_resources/noop.js3
-rw-r--r--src/web_accessible_resources/noop.json1
-rw-r--r--src/web_accessible_resources/noop.txt1
-rw-r--r--src/web_accessible_resources/outbrain-widget.js72
-rw-r--r--src/web_accessible_resources/popads-dummy.js30
-rw-r--r--src/web_accessible_resources/popads.js40
-rw-r--r--src/web_accessible_resources/prebid-ads.js26
-rw-r--r--src/web_accessible_resources/scorecardresearch_beacon.js31
44 files changed, 2359 insertions, 0 deletions
diff --git a/src/web_accessible_resources/1x1.gif b/src/web_accessible_resources/1x1.gif
new file mode 100644
index 0000000..e565824
--- /dev/null
+++ b/src/web_accessible_resources/1x1.gif
Binary files differ
diff --git a/src/web_accessible_resources/2x2.png b/src/web_accessible_resources/2x2.png
new file mode 100644
index 0000000..3639dc7
--- /dev/null
+++ b/src/web_accessible_resources/2x2.png
Binary files differ
diff --git a/src/web_accessible_resources/32x32.png b/src/web_accessible_resources/32x32.png
new file mode 100644
index 0000000..7bee0a0
--- /dev/null
+++ b/src/web_accessible_resources/32x32.png
Binary files differ
diff --git a/src/web_accessible_resources/3x2.png b/src/web_accessible_resources/3x2.png
new file mode 100644
index 0000000..a056d86
--- /dev/null
+++ b/src/web_accessible_resources/3x2.png
Binary files differ
diff --git a/src/web_accessible_resources/README.txt b/src/web_accessible_resources/README.txt
new file mode 100644
index 0000000..f9ab5c3
--- /dev/null
+++ b/src/web_accessible_resources/README.txt
@@ -0,0 +1,11 @@
+IMPORTANT
+
+Content of this folder cannot be accessed without the internal secret token
+created for each request to any of the "web accessible resources".
+
+Any fetch operation made without uBlock Origin's internal secret will result
+in failure. This means that despite the content of the folder here declared as
+"web accessible resources", it still cannot be seen by the outside world.
+
+Only uBlock Origin knows the secret token at runtime and hence only
+uBlock Origin can access the content of this folder.
diff --git a/src/web_accessible_resources/amazon_ads.js b/src/web_accessible_resources/amazon_ads.js
new file mode 100644
index 0000000..0b6e052
--- /dev/null
+++ b/src/web_accessible_resources/amazon_ads.js
@@ -0,0 +1,70 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2019-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+(function() {
+ 'use strict';
+ if ( amznads ) {
+ return;
+ }
+ var w = window;
+ var noopfn = function() {
+ ;
+ }.bind();
+ var amznads = {
+ appendScriptTag: noopfn,
+ appendTargetingToAdServerUrl: noopfn,
+ appendTargetingToQueryString: noopfn,
+ clearTargetingFromGPTAsync: noopfn,
+ doAllTasks: noopfn,
+ doGetAdsAsync: noopfn,
+ doTask: noopfn,
+ detectIframeAndGetURL: noopfn,
+ getAds: noopfn,
+ getAdsAsync: noopfn,
+ getAdForSlot: noopfn,
+ getAdsCallback: noopfn,
+ getDisplayAds: noopfn,
+ getDisplayAdsAsync: noopfn,
+ getDisplayAdsCallback: noopfn,
+ getKeys: noopfn,
+ getReferrerURL: noopfn,
+ getScriptSource: noopfn,
+ getTargeting: noopfn,
+ getTokens: noopfn,
+ getValidMilliseconds: noopfn,
+ getVideoAds: noopfn,
+ getVideoAdsAsync: noopfn,
+ getVideoAdsCallback: noopfn,
+ handleCallBack: noopfn,
+ hasAds: noopfn,
+ renderAd: noopfn,
+ saveAds: noopfn,
+ setTargeting: noopfn,
+ setTargetingForGPTAsync: noopfn,
+ setTargetingForGPTSync: noopfn,
+ tryGetAdsAsync: noopfn,
+ updateAds: noopfn
+ };
+ w.amznads = amznads;
+ w.amzn_ads = w.amzn_ads || noopfn;
+ w.aax_write = w.aax_write || noopfn;
+ w.aax_render_ad = w.aax_render_ad || noopfn;
+})();
diff --git a/src/web_accessible_resources/amazon_apstag.js b/src/web_accessible_resources/amazon_apstag.js
new file mode 100644
index 0000000..1ddd5a4
--- /dev/null
+++ b/src/web_accessible_resources/amazon_apstag.js
@@ -0,0 +1,62 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2019-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+// https://www.reddit.com/r/uBlockOrigin/comments/ghjqph/
+// https://github.com/NanoMeow/QuickReports/issues/3717
+// https://www.reddit.com/r/uBlockOrigin/comments/qyx7en/
+
+// https://searchfox.org/mozilla-central/source/browser/extensions/webcompat/shims/apstag.js
+// Import queue-related initialization code.
+
+(function() {
+ 'use strict';
+ const w = window;
+ const noopfn = function() {
+ ; // jshint ignore:line
+ }.bind();
+ const _Q = w.apstag && w.apstag._Q || [];
+ const apstag = {
+ _Q,
+ fetchBids: function(a, b) {
+ if ( typeof b === 'function' ) {
+ b([]);
+ }
+ },
+ init: noopfn,
+ setDisplayBids: noopfn,
+ targetingKeys: noopfn,
+ };
+ w.apstag = apstag;
+ _Q.push = function(prefix, args) {
+ try {
+ switch (prefix) {
+ case 'f':
+ apstag.fetchBids(...args);
+ break;
+ }
+ } catch (e) {
+ console.trace(e);
+ }
+ };
+ for ( const cmd of _Q ) {
+ _Q.push(cmd);
+ }
+})();
diff --git a/src/web_accessible_resources/ampproject_v0.js b/src/web_accessible_resources/ampproject_v0.js
new file mode 100644
index 0000000..e822f9d
--- /dev/null
+++ b/src/web_accessible_resources/ampproject_v0.js
@@ -0,0 +1,34 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2019-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+(function() {
+ 'use strict';
+ const head = document.head;
+ if ( !head ) { return; }
+ const style = document.createElement('style');
+ style.textContent = [
+ 'body {',
+ ' animation: none !important;',
+ ' overflow: unset !important;',
+ '}'
+ ].join('\n');
+ head.appendChild(style);
+})();
diff --git a/src/web_accessible_resources/chartbeat.js b/src/web_accessible_resources/chartbeat.js
new file mode 100644
index 0000000..76e7a29
--- /dev/null
+++ b/src/web_accessible_resources/chartbeat.js
@@ -0,0 +1,30 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2019-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+(function() {
+ 'use strict';
+ const noopfn = function() {
+ };
+ window.pSUPERFLY = {
+ activity: noopfn,
+ virtualPage: noopfn
+ };
+})();
diff --git a/src/web_accessible_resources/click2load.html b/src/web_accessible_resources/click2load.html
new file mode 100644
index 0000000..7ec52b9
--- /dev/null
+++ b/src/web_accessible_resources/click2load.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html id="ublock0-clicktoload">
+
+<head>
+<meta charset="utf-8">
+<title>uBlock Origin Click-to-Load</title>
+<link rel="stylesheet" href="../css/themes/default.css">
+<link rel="stylesheet" href="../css/common.css">
+<link rel="stylesheet" href="../css/fa-icons.css">
+<link rel="stylesheet" href="../css/click2load.css">
+</head>
+
+<body>
+
+<span class="logo"><img src="../img/ublock.svg"></span>
+<span id="clickToLoad" data-i18n="clickToLoad"></span>
+<div id="frameURL"><span></span>&nbsp;<a class="fa-icon" href="" rel="noreferrer noopener" target="_blank">external-link</a></div>
+
+<script src="../js/fa-icons.js" type="module"></script>
+<script src="../js/vapi.js"></script>
+<script src="../js/vapi-common.js"></script>
+<script src="../js/vapi-client.js"></script>
+<script src="../js/theme.js" type="module"></script>
+<script src="../js/i18n.js" type="module"></script>
+<script src="../js/click2load.js" type="module"></script>
+
+</body>
+</html>
diff --git a/src/web_accessible_resources/dom-inspector.html b/src/web_accessible_resources/dom-inspector.html
new file mode 100644
index 0000000..d338610
--- /dev/null
+++ b/src/web_accessible_resources/dom-inspector.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html id="ublock0-inspector">
+
+<head>
+<meta charset="utf-8">
+<meta name="color-scheme" content="light dark">
+<title>uBlock Origin Inspector</title>
+<link rel="stylesheet" href="../css/dom-inspector.css">
+</head>
+
+<body>
+<svg>
+ <path d></path>
+ <path d></path>
+ <path d></path>
+ <path d></path>
+</svg>
+
+<script src="../js/vapi.js"></script>
+<script src="../js/vapi-common.js"></script>
+<script src="../js/vapi-client.js"></script>
+<script src="../js/dom-inspector.js" type="module"></script>
+
+</body>
+</html>
diff --git a/src/web_accessible_resources/doubleclick_instream_ad_status.js b/src/web_accessible_resources/doubleclick_instream_ad_status.js
new file mode 100644
index 0000000..dfec48c
--- /dev/null
+++ b/src/web_accessible_resources/doubleclick_instream_ad_status.js
@@ -0,0 +1 @@
+window.google_ad_status = 1;
diff --git a/src/web_accessible_resources/empty b/src/web_accessible_resources/empty
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/web_accessible_resources/empty
diff --git a/src/web_accessible_resources/epicker-ui.html b/src/web_accessible_resources/epicker-ui.html
new file mode 100644
index 0000000..bd92f50
--- /dev/null
+++ b/src/web_accessible_resources/epicker-ui.html
@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<html id="ublock0-epicker">
+
+<head>
+<meta charset="utf-8">
+<meta name="color-scheme" content="light dark">
+<title>uBlock Origin Element Picker</title>
+<link rel="stylesheet" href="../lib/codemirror/lib/codemirror.css">
+<link rel="stylesheet" href="../lib/codemirror/addon/hint/show-hint.css">
+
+<link rel="stylesheet" href="../css/themes/default.css">
+<link rel="stylesheet" href="../css/common.css">
+<link rel="stylesheet" href="../css/epicker-ui.css">
+<link rel="stylesheet" href="../css/codemirror.css">
+</head>
+
+<body>
+<aside>
+<section>
+ <div>
+ <div class="codeMirrorContainer codeMirrorBreakAll cm-theme-override"></div>
+ <div class="resultsetWidgets">
+ <span id="resultsetModifiers">
+ <span id="resultsetDepth" class="resultsetModifier">
+ <span><span></span><span></span><span></span></span>
+ <input type="range" min="0" max="7" value="7">
+ </span>
+ <span id="resultsetSpecificity" class="resultsetModifier">
+ <span><span></span><span></span><span></span></span>
+ <input type="range" min="0" max="7" value="6">
+ </span>
+ </span>
+ <span id="resultsetCount"></span>
+ </div>
+ </div>
+ <div id="toolbar">
+ <div>
+ <button id="preview" type="button" data-i18n="pickerPreview">_<span class="hover"></span></button>
+ </div>
+ <div id="move"></div>
+ <div>
+ <button id="create" type="button" class="preferred" disabled data-i18n="pickerCreate">_<span class="hover"></span></button>
+ <button id="pick" type="button" data-i18n="pickerPick">_<span class="hover"></span></button>
+ <button id="quit" type="button" data-i18n="pickerQuit">_<span class="hover"></span></button>
+ </div>
+ </div>
+</section>
+<ul id="candidateFilters">
+ <li id="netFilters">
+ <span data-i18n="pickerNetFilters"></span>
+ <ul lang="en" class="changeFilter"></ul>
+ </li>
+ <li id="cosmeticFilters" data-specificity="3">
+ <span data-i18n="pickerCosmeticFilters"></span>
+ <ul lang="en" class="changeFilter"></ul>
+ </li>
+</ul>
+</aside>
+<svg><path d></path><path d></path></svg>
+
+<script src="../lib/codemirror/lib/codemirror.js"></script>
+<script src="../lib/codemirror/addon/edit/closebrackets.js"></script>
+<script src="../lib/codemirror/addon/edit/matchbrackets.js"></script>
+<script src="../lib/codemirror/addon/hint/show-hint.js"></script>
+<script src="../lib/hsluv/hsluv-0.1.0.min.js"></script>
+
+<script src="../js/vapi.js"></script>
+<script src="../js/vapi-common.js"></script>
+<script src="../js/vapi-client.js"></script>
+<script src="../js/theme.js" type="module"></script>
+<script src="../js/i18n.js" type="module"></script>
+<script src="../js/epicker-ui.js" type="module"></script>
+
+</body>
+</html>
diff --git a/src/web_accessible_resources/fingerprint2.js b/src/web_accessible_resources/fingerprint2.js
new file mode 100644
index 0000000..24a39b9
--- /dev/null
+++ b/src/web_accessible_resources/fingerprint2.js
@@ -0,0 +1,55 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2014-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+// Reference:
+// https://github.com/fingerprintjs/fingerprintjs/tree/v2
+
+(function() {
+ 'use strict';
+ const hex32 = len => {
+ return Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)
+ .toString(16)
+ .slice(-len)
+ .padStart(len, '0');
+ };
+ const browserId = `${hex32(8)}${hex32(8)}${hex32(8)}${hex32(8)}`;
+ const fp2 = function(){};
+ fp2.get = function(opts, cb) {
+ if ( !cb ) { cb = opts; }
+ setTimeout(( ) => { cb([]); }, 1);
+ };
+ fp2.getPromise = function() {
+ return Promise.resolve([]);
+ };
+ fp2.getV18 = function() {
+ return browserId;
+ };
+ fp2.x64hash128 = function() {
+ return browserId;
+ };
+ fp2.prototype = {
+ get: function(opts, cb) {
+ if ( !cb ) { cb = opts; }
+ setTimeout(( ) => { cb(browserId, []); }, 1);
+ },
+ };
+ self.Fingerprint2 = fp2;
+})();
diff --git a/src/web_accessible_resources/fingerprint3.js b/src/web_accessible_resources/fingerprint3.js
new file mode 100644
index 0000000..1bf1529
--- /dev/null
+++ b/src/web_accessible_resources/fingerprint3.js
@@ -0,0 +1,45 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2022-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+(function() {
+ 'use strict';
+ const visitorId = (( ) => {
+ let id = '';
+ for ( let i = 0; i < 8; i++ ) {
+ id += (Math.random() * 0x10000 + 0x1000 | 0).toString(16).slice(-4);
+ }
+ return id;
+ })();
+ const FingerprintJS = class {
+ static hashComponents() {
+ return visitorId;
+ }
+ static load() {
+ return Promise.resolve(new FingerprintJS());
+ }
+ get() {
+ return Promise.resolve({
+ visitorId,
+ });
+ }
+ };
+ window.FingerprintJS = FingerprintJS;
+})();
diff --git a/src/web_accessible_resources/google-analytics_analytics.js b/src/web_accessible_resources/google-analytics_analytics.js
new file mode 100644
index 0000000..6fdf396
--- /dev/null
+++ b/src/web_accessible_resources/google-analytics_analytics.js
@@ -0,0 +1,110 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2019-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+(function() {
+ 'use strict';
+ // https://developers.google.com/analytics/devguides/collection/analyticsjs/
+ const noopfn = function() {
+ };
+ //
+ const Tracker = function() {
+ };
+ const p = Tracker.prototype;
+ p.get = noopfn;
+ p.set = noopfn;
+ p.send = noopfn;
+ //
+ const w = window;
+ const gaName = w.GoogleAnalyticsObject || 'ga';
+ const gaQueue = w[gaName];
+ // https://github.com/uBlockOrigin/uAssets/pull/4115
+ const ga = function() {
+ const len = arguments.length;
+ if ( len === 0 ) { return; }
+ const args = Array.from(arguments);
+ let fn;
+ let a = args[len-1];
+ if ( a instanceof Object && a.hitCallback instanceof Function ) {
+ fn = a.hitCallback;
+ } else if ( a instanceof Function ) {
+ fn = ( ) => { a(ga.create()); };
+ } else {
+ const pos = args.indexOf('hitCallback');
+ if ( pos !== -1 && args[pos+1] instanceof Function ) {
+ fn = args[pos+1];
+ }
+ }
+ if ( fn instanceof Function === false ) { return; }
+ try {
+ fn();
+ } catch (ex) {
+ }
+ };
+ ga.create = function() {
+ return new Tracker();
+ };
+ ga.getByName = function() {
+ return new Tracker();
+ };
+ ga.getAll = function() {
+ return [new Tracker()];
+ };
+ ga.remove = noopfn;
+ // https://github.com/uBlockOrigin/uAssets/issues/2107
+ ga.loaded = true;
+ w[gaName] = ga;
+ // https://github.com/gorhill/uBlock/issues/3075
+ const dl = w.dataLayer;
+ if ( dl instanceof Object ) {
+ if ( dl.hide instanceof Object && typeof dl.hide.end === 'function' ) {
+ dl.hide.end();
+ dl.hide.end = ()=>{};
+ }
+ if ( typeof dl.push === 'function' ) {
+ const doCallback = function(item) {
+ if ( item instanceof Object === false ) { return; }
+ if ( typeof item.eventCallback !== 'function' ) { return; }
+ setTimeout(item.eventCallback, 1);
+ item.eventCallback = ()=>{};
+ };
+ dl.push = new Proxy(dl.push, {
+ apply: function(target, thisArg, args) {
+ doCallback(args[0]);
+ return Reflect.apply(target, thisArg, args);
+ }
+ });
+ if ( Array.isArray(dl) ) {
+ const q = dl.slice();
+ for ( const item of q ) {
+ doCallback(item);
+ }
+ }
+ }
+ }
+ // empty ga queue
+ if ( gaQueue instanceof Function && Array.isArray(gaQueue.q) ) {
+ const q = gaQueue.q.slice();
+ gaQueue.q.length = 0;
+ for ( const entry of q ) {
+ ga(...entry);
+ }
+ }
+})();
diff --git a/src/web_accessible_resources/google-analytics_cx_api.js b/src/web_accessible_resources/google-analytics_cx_api.js
new file mode 100644
index 0000000..9f63ebe
--- /dev/null
+++ b/src/web_accessible_resources/google-analytics_cx_api.js
@@ -0,0 +1,36 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2019-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+(function() {
+ 'use strict';
+ const noopfn = function() {
+ };
+ window.cxApi = {
+ chooseVariation: function() {
+ return 0;
+ },
+ getChosenVariation: noopfn,
+ setAllowHash: noopfn,
+ setChosenVariation: noopfn,
+ setCookiePath: noopfn,
+ setDomainName: noopfn
+ };
+})();
diff --git a/src/web_accessible_resources/google-analytics_ga.js b/src/web_accessible_resources/google-analytics_ga.js
new file mode 100644
index 0000000..c969b38
--- /dev/null
+++ b/src/web_accessible_resources/google-analytics_ga.js
@@ -0,0 +1,130 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2019-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+(function() {
+ 'use strict';
+ const noopfn = function() {
+ };
+ //
+ const Gaq = function() {
+ };
+ Gaq.prototype.Na = noopfn;
+ Gaq.prototype.O = noopfn;
+ Gaq.prototype.Sa = noopfn;
+ Gaq.prototype.Ta = noopfn;
+ Gaq.prototype.Va = noopfn;
+ Gaq.prototype._createAsyncTracker = noopfn;
+ Gaq.prototype._getAsyncTracker = noopfn;
+ Gaq.prototype._getPlugin = noopfn;
+ Gaq.prototype.push = function(a) {
+ if ( typeof a === 'function' ) {
+ a(); return;
+ }
+ if ( Array.isArray(a) === false ) { return; }
+ // https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiDomainDirectory#_gat.GA_Tracker_._link
+ // https://github.com/uBlockOrigin/uBlock-issues/issues/1807
+ if (
+ typeof a[0] === 'string' &&
+ /(^|\.)_link$/.test(a[0]) &&
+ typeof a[1] === 'string'
+ ) {
+ try {
+ window.location.assign(a[1]);
+ } catch(ex) {
+ }
+ }
+ // https://github.com/gorhill/uBlock/issues/2162
+ if ( a[0] === '_set' && a[1] === 'hitCallback' && typeof a[2] === 'function' ) {
+ a[2]();
+ }
+ };
+ //
+ const tracker = (function() {
+ const out = {};
+ const api = [
+ '_addIgnoredOrganic _addIgnoredRef _addItem _addOrganic',
+ '_addTrans _clearIgnoredOrganic _clearIgnoredRef _clearOrganic',
+ '_cookiePathCopy _deleteCustomVar _getName _setAccount',
+ '_getAccount _getClientInfo _getDetectFlash _getDetectTitle',
+ '_getLinkerUrl _getLocalGifPath _getServiceMode _getVersion',
+ '_getVisitorCustomVar _initData _linkByPost',
+ '_setAllowAnchor _setAllowHash _setAllowLinker _setCampContentKey',
+ '_setCampMediumKey _setCampNameKey _setCampNOKey _setCampSourceKey',
+ '_setCampTermKey _setCampaignCookieTimeout _setCampaignTrack _setClientInfo',
+ '_setCookiePath _setCookiePersistence _setCookieTimeout _setCustomVar',
+ '_setDetectFlash _setDetectTitle _setDomainName _setLocalGifPath',
+ '_setLocalRemoteServerMode _setLocalServerMode _setReferrerOverride _setRemoteServerMode',
+ '_setSampleRate _setSessionTimeout _setSiteSpeedSampleRate _setSessionCookieTimeout',
+ '_setVar _setVisitorCookieTimeout _trackEvent _trackPageLoadTime',
+ '_trackPageview _trackSocial _trackTiming _trackTrans',
+ '_visitCode'
+ ].join(' ').split(/\s+/);
+ for ( const method of api ) {
+ out[method] = noopfn;
+ }
+ out._getLinkerUrl = function(a) {
+ return a;
+ };
+ // https://github.com/AdguardTeam/Scriptlets/issues/154
+ out._link = function(a) {
+ if ( typeof a !== 'string' ) { return; }
+ try {
+ window.location.assign(a);
+ } catch(ex) {
+ }
+ };
+ return out;
+ })();
+ //
+ const Gat = function() {
+ };
+ Gat.prototype._anonymizeIP = noopfn;
+ Gat.prototype._createTracker = noopfn;
+ Gat.prototype._forceSSL = noopfn;
+ Gat.prototype._getPlugin = noopfn;
+ Gat.prototype._getTracker = function() {
+ return tracker;
+ };
+ Gat.prototype._getTrackerByName = function() {
+ return tracker;
+ };
+ Gat.prototype._getTrackers = noopfn;
+ Gat.prototype.aa = noopfn;
+ Gat.prototype.ab = noopfn;
+ Gat.prototype.hb = noopfn;
+ Gat.prototype.la = noopfn;
+ Gat.prototype.oa = noopfn;
+ Gat.prototype.pa = noopfn;
+ Gat.prototype.u = noopfn;
+ const gat = new Gat();
+ window._gat = gat;
+ //
+ const gaq = new Gaq();
+ (function() {
+ const aa = window._gaq || [];
+ if ( Array.isArray(aa) ) {
+ while ( aa[0] ) {
+ gaq.push(aa.shift());
+ }
+ }
+ })();
+ window._gaq = gaq.qf = gaq;
+})();
diff --git a/src/web_accessible_resources/google-analytics_inpage_linkid.js b/src/web_accessible_resources/google-analytics_inpage_linkid.js
new file mode 100644
index 0000000..e893ca9
--- /dev/null
+++ b/src/web_accessible_resources/google-analytics_inpage_linkid.js
@@ -0,0 +1,28 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2019-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+(function() {
+ 'use strict';
+ window._gaq = window._gaq || {
+ push: function() {
+ }
+ };
+})();
diff --git a/src/web_accessible_resources/google-ima.js b/src/web_accessible_resources/google-ima.js
new file mode 100644
index 0000000..4556516
--- /dev/null
+++ b/src/web_accessible_resources/google-ima.js
@@ -0,0 +1,855 @@
+/**
+ *
+ * Source below is based on Mozilla source code:
+ * https://searchfox.org/mozilla-central/rev/d317e93d9a59c9e4c06ada85fbff9f6a1ceaaad1/browser/extensions/webcompat/shims/google-ima.js
+ *
+ * Modifications to the original code below this comment:
+ * - Avoid JS syntax not supported by older browser versions
+ * - Add missing shim event
+ * - Modified to avoid jshint warnings as per uBO's config
+ * - Added `OmidVerificationVendor` to `ima`
+ * - Have `AdError.getInnerError()` return `null`
+ * - Have `AdDisplayContainer` constructor add DIV element to container
+ * - Added missing event dispatcher functionality
+ * - Corrected return type of `Ad.getUniversalAdIds()`
+ * - Corrected typo in `UniversalAdIdInfo.getAdIdValue()` method name
+ * - Corrected dispatch of LOAD event when preloading is enabled
+ * - Corrected dispatch of CONTENT_PAUSE/RESUME_REQUESTED events
+ *
+ * Related issue:
+ * - https://github.com/uBlockOrigin/uBlock-issues/issues/2158
+ *
+**/
+
+'use strict';
+
+/* 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/. */
+
+/**
+ * Bug 1713690 - Shim Google Interactive Media Ads ima3.js
+ *
+ * Many sites use ima3.js for ad bidding and placement, often in conjunction
+ * with Google Publisher Tags, Prebid.js and/or other scripts. This shim
+ * provides a stubbed-out version of the API which helps work around related
+ * site breakage, such as black bxoes where videos ought to be placed.
+ */
+
+if (!window.google || !window.google.ima || !window.google.ima.VERSION) {
+ const VERSION = "3.517.2";
+
+ const CheckCanAutoplay = (function() {
+ // Sourced from: https://searchfox.org/mozilla-central/source/dom/media/gtest/negative_duration.mp4
+ const TEST_VIDEO = new Blob(
+ [
+ new Uint32Array([
+ 469762048,
+ 1887007846,
+ 1752392036,
+ 0,
+ 913273705,
+ 1717987696,
+ 828601953,
+ -1878917120,
+ 1987014509,
+ 1811939328,
+ 1684567661,
+ 0,
+ 0,
+ 0,
+ -402456576,
+ 0,
+ 256,
+ 1,
+ 0,
+ 0,
+ 256,
+ 0,
+ 0,
+ 0,
+ 256,
+ 0,
+ 0,
+ 0,
+ 64,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 33554432,
+ -201261056,
+ 1801548404,
+ 1744830464,
+ 1684564852,
+ 251658241,
+ 0,
+ 0,
+ 0,
+ 0,
+ 16777216,
+ 0,
+ -1,
+ -1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 256,
+ 0,
+ 0,
+ 0,
+ 256,
+ 0,
+ 0,
+ 0,
+ 64,
+ 5,
+ 53250,
+ -2080309248,
+ 1634296941,
+ 738197504,
+ 1684563053,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ -2137614336,
+ -1,
+ -1,
+ 50261,
+ 754974720,
+ 1919706216,
+ 0,
+ 0,
+ 1701079414,
+ 0,
+ 0,
+ 0,
+ 1701079382,
+ 1851869295,
+ 1919249508,
+ 16777216,
+ 1852402979,
+ 102,
+ 1752004116,
+ 100,
+ 1,
+ 0,
+ 0,
+ 1852400676,
+ 102,
+ 1701995548,
+ 102,
+ 0,
+ 1,
+ 1819440396,
+ 32,
+ 1,
+ 1651799011,
+ 108,
+ 1937011607,
+ 100,
+ 0,
+ 1,
+ 1668702599,
+ 49,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 33555712,
+ 4718800,
+ 4718592,
+ 0,
+ 65536,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 16776984,
+ 1630601216,
+ 21193590,
+ -14745500,
+ 1729626337,
+ -1407254428,
+ 89161945,
+ 1049019,
+ 9453056,
+ -251611125,
+ 27269507,
+ -379058688,
+ -1329024392,
+ 268435456,
+ 1937011827,
+ 0,
+ 0,
+ 268435456,
+ 1668510835,
+ 0,
+ 0,
+ 335544320,
+ 2054386803,
+ 0,
+ 0,
+ 0,
+ 268435456,
+ 1868788851,
+ 0,
+ 0,
+ 671088640,
+ 2019915373,
+ 536870912,
+ 2019914356,
+ 0,
+ 16777216,
+ 16777216,
+ 0,
+ 0,
+ 0,
+ ]),
+ ],
+ { type: "video/mp4" }
+ );
+
+ let testVideo;
+
+ return function() {
+ if (!testVideo) {
+ testVideo = document.createElement("video");
+ testVideo.style =
+ "position:absolute; width:0; height:0; left:0; right:0; z-index:-1; border:0";
+ testVideo.setAttribute("muted", "muted");
+ testVideo.setAttribute("playsinline", "playsinline");
+ testVideo.src = URL.createObjectURL(TEST_VIDEO);
+ document.body.appendChild(testVideo);
+ }
+ return testVideo.play();
+ };
+ })();
+
+ const ima = {};
+
+ class AdDisplayContainer {
+ constructor(containerElement) {
+ const divElement = document.createElement("div");
+ divElement.style.setProperty("display", "none", "important");
+ divElement.style.setProperty("visibility", "collapse", "important");
+ containerElement.appendChild(divElement);
+ }
+ destroy() {}
+ initialize() {}
+ }
+
+ class ImaSdkSettings {
+ constructor() {
+ this.c = true;
+ this.f = {};
+ this.i = false;
+ this.l = "";
+ this.p = "";
+ this.r = 0;
+ this.t = "";
+ this.v = "";
+ }
+ getCompanionBackfill() {}
+ getDisableCustomPlaybackForIOS10Plus() {
+ return this.i;
+ }
+ getFeatureFlags() {
+ return this.f;
+ }
+ getLocale() {
+ return this.l;
+ }
+ getNumRedirects() {
+ return this.r;
+ }
+ getPlayerType() {
+ return this.t;
+ }
+ getPlayerVersion() {
+ return this.v;
+ }
+ getPpid() {
+ return this.p;
+ }
+ isCookiesEnabled() {
+ return this.c;
+ }
+ setAutoPlayAdBreaks() {}
+ setCompanionBackfill() {}
+ setCookiesEnabled(c) {
+ this.c = !!c;
+ }
+ setDisableCustomPlaybackForIOS10Plus(i) {
+ this.i = !!i;
+ }
+ setFeatureFlags(f) {
+ this.f = f;
+ }
+ setLocale(l) {
+ this.l = l;
+ }
+ setNumRedirects(r) {
+ this.r = r;
+ }
+ setPlayerType(t) {
+ this.t = t;
+ }
+ setPlayerVersion(v) {
+ this.v = v;
+ }
+ setPpid(p) {
+ this.p = p;
+ }
+ setSessionId(/*s*/) {}
+ setVpaidAllowed(/*a*/) {}
+ setVpaidMode(/*m*/) {}
+
+ // https://github.com/uBlockOrigin/uBlock-issues/issues/2265#issuecomment-1637094149
+ getDisableFlashAds() {
+ }
+ setDisableFlashAds() {
+ }
+ }
+ ImaSdkSettings.CompanionBackfillMode = {
+ ALWAYS: "always",
+ ON_MASTER_AD: "on_master_ad",
+ };
+ ImaSdkSettings.VpaidMode = {
+ DISABLED: 0,
+ ENABLED: 1,
+ INSECURE: 2,
+ };
+
+ class EventHandler {
+ constructor() {
+ this.listeners = new Map();
+ }
+
+ _dispatch(e) {
+ let listeners = this.listeners.get(e.type);
+ listeners = listeners ? Array.from(listeners.values()) : [];
+ for (const listener of listeners) {
+ try {
+ listener(e);
+ } catch (r) {
+ console.error(r);
+ }
+ }
+ }
+
+ addEventListener(types, c, options, context) {
+ if (!Array.isArray(types)) {
+ types = [types];
+ }
+
+ for (const t of types) {
+ if (!this.listeners.has(t)) {
+ this.listeners.set(t, new Map());
+ }
+ this.listeners.get(t).set(c, c.bind(context || this));
+ }
+ }
+
+ removeEventListener(types, c) {
+ if (!Array.isArray(types)) {
+ types = [types];
+ }
+
+ for (const t of types) {
+ const typeSet = this.listeners.get(t);
+ if (typeSet) {
+ typeSet.delete(c);
+ }
+ }
+ }
+ }
+
+ class AdsLoader extends EventHandler {
+ constructor() {
+ super();
+ this.settings = new ImaSdkSettings();
+ }
+ contentComplete() {}
+ destroy() {}
+ getSettings() {
+ return this.settings;
+ }
+ getVersion() {
+ return VERSION;
+ }
+ requestAds(/*r, c*/) {
+ // If autoplay is disabled and the page is trying to autoplay a tracking
+ // ad, then IMA fails with an error, and the page is expected to request
+ // ads again later when the user clicks to play.
+ CheckCanAutoplay().then(
+ () => {
+ const { ADS_MANAGER_LOADED } = AdsManagerLoadedEvent.Type;
+ this._dispatch(new ima.AdsManagerLoadedEvent(ADS_MANAGER_LOADED));
+ },
+ () => {
+ const e = new ima.AdError(
+ "adPlayError",
+ 1205,
+ 1205,
+ "The browser prevented playback initiated without user interaction."
+ );
+ this._dispatch(new ima.AdErrorEvent(e));
+ }
+ );
+ }
+ }
+
+ class AdsManager extends EventHandler {
+ constructor() {
+ super();
+ this.volume = 1;
+ this._enablePreloading = false;
+ }
+ collapse() {}
+ configureAdsManager() {}
+ destroy() {}
+ discardAdBreak() {}
+ expand() {}
+ focus() {}
+ getAdSkippableState() {
+ return false;
+ }
+ getCuePoints() {
+ return [0];
+ }
+ getCurrentAd() {
+ return currentAd;
+ }
+ getCurrentAdCuePoints() {
+ return [];
+ }
+ getRemainingTime() {
+ return 0;
+ }
+ getVolume() {
+ return this.volume;
+ }
+ init(/*w, h, m, e*/) {
+ if (this._enablePreloading) {
+ this._dispatch(new ima.AdEvent(AdEvent.Type.LOADED));
+ }
+ }
+ isCustomClickTrackingUsed() {
+ return false;
+ }
+ isCustomPlaybackUsed() {
+ return false;
+ }
+ pause() {}
+ requestNextAdBreak() {}
+ resize(/*w, h, m*/) {}
+ resume() {}
+ setVolume(v) {
+ this.volume = v;
+ }
+ skip() {}
+ start() {
+ requestAnimationFrame(() => {
+ for (const type of [
+ AdEvent.Type.LOADED,
+ AdEvent.Type.STARTED,
+ AdEvent.Type.CONTENT_PAUSE_REQUESTED,
+ AdEvent.Type.AD_BUFFERING,
+ AdEvent.Type.FIRST_QUARTILE,
+ AdEvent.Type.MIDPOINT,
+ AdEvent.Type.THIRD_QUARTILE,
+ AdEvent.Type.COMPLETE,
+ AdEvent.Type.ALL_ADS_COMPLETED,
+ AdEvent.Type.CONTENT_RESUME_REQUESTED,
+ ]) {
+ try {
+ this._dispatch(new ima.AdEvent(type));
+ } catch (e) {
+ console.error(e);
+ }
+ }
+ });
+ }
+ stop() {}
+ updateAdsRenderingSettings(/*s*/) {}
+ }
+
+ class AdsRenderingSettings {}
+
+ class AdsRequest {
+ setAdWillAutoPlay() {}
+ setAdWillPlayMuted() {}
+ setContinuousPlayback() {}
+ }
+
+ class AdPodInfo {
+ getAdPosition() {
+ return 1;
+ }
+ getIsBumper() {
+ return false;
+ }
+ getMaxDuration() {
+ return -1;
+ }
+ getPodIndex() {
+ return 1;
+ }
+ getTimeOffset() {
+ return 0;
+ }
+ getTotalAds() {
+ return 1;
+ }
+ }
+
+ class Ad {
+ constructor() {
+ this._pi = new AdPodInfo();
+ }
+ getAdId() {
+ return "";
+ }
+ getAdPodInfo() {
+ return this._pi;
+ }
+ getAdSystem() {
+ return "";
+ }
+ getAdvertiserName() {
+ return "";
+ }
+ getApiFramework() {
+ return null;
+ }
+ getCompanionAds() {
+ return [];
+ }
+ getContentType() {
+ return "";
+ }
+ getCreativeAdId() {
+ return "";
+ }
+ getCreativeId() {
+ return "";
+ }
+ getDealId() {
+ return "";
+ }
+ getDescription() {
+ return "";
+ }
+ getDuration() {
+ return 8.5;
+ }
+ getHeight() {
+ return 0;
+ }
+ getMediaUrl() {
+ return null;
+ }
+ getMinSuggestedDuration() {
+ return -2;
+ }
+ getSkipTimeOffset() {
+ return -1;
+ }
+ getSurveyUrl() {
+ return null;
+ }
+ getTitle() {
+ return "";
+ }
+ getTraffickingParameters() {
+ return {};
+ }
+ getTraffickingParametersString() {
+ return "";
+ }
+ getUiElements() {
+ return [""];
+ }
+ getUniversalAdIdRegistry() {
+ return "unknown";
+ }
+ getUniversalAdIds() {
+ return [new UniversalAdIdInfo()];
+ }
+ getUniversalAdIdValue() {
+ return "unknown";
+ }
+ getVastMediaBitrate() {
+ return 0;
+ }
+ getVastMediaHeight() {
+ return 0;
+ }
+ getVastMediaWidth() {
+ return 0;
+ }
+ getWidth() {
+ return 0;
+ }
+ getWrapperAdIds() {
+ return [""];
+ }
+ getWrapperAdSystems() {
+ return [""];
+ }
+ getWrapperCreativeIds() {
+ return [""];
+ }
+ isLinear() {
+ return true;
+ }
+ isSkippable() {
+ return true;
+ }
+ }
+
+ class CompanionAd {
+ getAdSlotId() {
+ return "";
+ }
+ getContent() {
+ return "";
+ }
+ getContentType() {
+ return "";
+ }
+ getHeight() {
+ return 1;
+ }
+ getWidth() {
+ return 1;
+ }
+ }
+
+ class AdError {
+ constructor(type, code, vast, message) {
+ this.errorCode = code;
+ this.message = message;
+ this.type = type;
+ this.vastErrorCode = vast;
+ }
+ getErrorCode() {
+ return this.errorCode;
+ }
+ getInnerError() {
+ return null;
+ }
+ getMessage() {
+ return this.message;
+ }
+ getType() {
+ return this.type;
+ }
+ getVastErrorCode() {
+ return this.vastErrorCode;
+ }
+ toString() {
+ return `AdError ${this.errorCode}: ${this.message}`;
+ }
+ }
+ AdError.ErrorCode = {};
+ AdError.Type = {};
+
+ const isEngadget = () => {
+ try {
+ for (const ctx of Object.values(window.vidible._getContexts())) {
+ const player = ctx.getPlayer();
+ if (!player) { continue;}
+ const div = player.div;
+ if (!div) { continue; }
+ if (div.innerHTML.includes("www.engadget.com")) {
+ return true;
+ }
+ }
+ } catch (_) {}
+ return false;
+ };
+
+ const currentAd = isEngadget() ? undefined : new Ad();
+
+ class AdEvent {
+ constructor(type) {
+ this.type = type;
+ }
+ getAd() {
+ return currentAd;
+ }
+ getAdData() {
+ return {};
+ }
+ }
+ AdEvent.Type = {
+ AD_BREAK_READY: "adBreakReady",
+ AD_BUFFERING: "adBuffering",
+ AD_CAN_PLAY: "adCanPlay",
+ AD_METADATA: "adMetadata",
+ AD_PROGRESS: "adProgress",
+ ALL_ADS_COMPLETED: "allAdsCompleted",
+ CLICK: "click",
+ COMPLETE: "complete",
+ CONTENT_PAUSE_REQUESTED: "contentPauseRequested",
+ CONTENT_RESUME_REQUESTED: "contentResumeRequested",
+ DURATION_CHANGE: "durationChange",
+ EXPANDED_CHANGED: "expandedChanged",
+ FIRST_QUARTILE: "firstQuartile",
+ IMPRESSION: "impression",
+ INTERACTION: "interaction",
+ LINEAR_CHANGE: "linearChange",
+ LINEAR_CHANGED: "linearChanged",
+ LOADED: "loaded",
+ LOG: "log",
+ MIDPOINT: "midpoint",
+ PAUSED: "pause",
+ RESUMED: "resume",
+ SKIPPABLE_STATE_CHANGED: "skippableStateChanged",
+ SKIPPED: "skip",
+ STARTED: "start",
+ THIRD_QUARTILE: "thirdQuartile",
+ USER_CLOSE: "userClose",
+ VIDEO_CLICKED: "videoClicked",
+ VIDEO_ICON_CLICKED: "videoIconClicked",
+ VIEWABLE_IMPRESSION: "viewable_impression",
+ VOLUME_CHANGED: "volumeChange",
+ VOLUME_MUTED: "mute",
+ };
+
+ class AdErrorEvent {
+ constructor(error) {
+ this.type = "adError";
+ this.error = error;
+ }
+ getError() {
+ return this.error;
+ }
+ getUserRequestContext() {
+ return {};
+ }
+ }
+ AdErrorEvent.Type = {
+ AD_ERROR: "adError",
+ };
+
+ const manager = new AdsManager();
+
+ class AdsManagerLoadedEvent {
+ constructor(type) {
+ this.type = type;
+ }
+ getAdsManager(c, settings) {
+ if (settings && settings.enablePreloading) {
+ manager._enablePreloading = true;
+ }
+ return manager;
+ }
+ getUserRequestContext() {
+ return {};
+ }
+ }
+ AdsManagerLoadedEvent.Type = {
+ ADS_MANAGER_LOADED: "adsManagerLoaded",
+ };
+
+ class CustomContentLoadedEvent {}
+ CustomContentLoadedEvent.Type = {
+ CUSTOM_CONTENT_LOADED: "deprecated-event",
+ };
+
+ class CompanionAdSelectionSettings {}
+ CompanionAdSelectionSettings.CreativeType = {
+ ALL: "All",
+ FLASH: "Flash",
+ IMAGE: "Image",
+ };
+ CompanionAdSelectionSettings.ResourceType = {
+ ALL: "All",
+ HTML: "Html",
+ IFRAME: "IFrame",
+ STATIC: "Static",
+ };
+ CompanionAdSelectionSettings.SizeCriteria = {
+ IGNORE: "IgnoreSize",
+ SELECT_EXACT_MATCH: "SelectExactMatch",
+ SELECT_NEAR_MATCH: "SelectNearMatch",
+ };
+
+ class AdCuePoints {
+ getCuePoints() {
+ return [];
+ }
+ }
+
+ class AdProgressData {}
+
+ class UniversalAdIdInfo {
+ getAdIdRegistry() {
+ return "";
+ }
+ getAdIdValue() {
+ return "";
+ }
+ }
+
+ Object.assign(ima, {
+ AdCuePoints,
+ AdDisplayContainer,
+ AdError,
+ AdErrorEvent,
+ AdEvent,
+ AdPodInfo,
+ AdProgressData,
+ AdsLoader,
+ AdsManager: manager,
+ AdsManagerLoadedEvent,
+ AdsRenderingSettings,
+ AdsRequest,
+ CompanionAd,
+ CompanionAdSelectionSettings,
+ CustomContentLoadedEvent,
+ gptProxyInstance: {},
+ ImaSdkSettings,
+ OmidAccessMode: {
+ DOMAIN: "domain",
+ FULL: "full",
+ LIMITED: "limited",
+ },
+ OmidVerificationVendor: {
+ 1: "OTHER",
+ 2: "GOOGLE",
+ GOOGLE: 2,
+ OTHER: 1
+ },
+ settings: new ImaSdkSettings(),
+ UiElements: {
+ AD_ATTRIBUTION: "adAttribution",
+ COUNTDOWN: "countdown",
+ },
+ UniversalAdIdInfo,
+ VERSION,
+ ViewMode: {
+ FULLSCREEN: "fullscreen",
+ NORMAL: "normal",
+ },
+ });
+
+ if (!window.google) {
+ window.google = {};
+ }
+
+ window.google.ima = ima;
+}
diff --git a/src/web_accessible_resources/googlesyndication_adsbygoogle.js b/src/web_accessible_resources/googlesyndication_adsbygoogle.js
new file mode 100644
index 0000000..dec634b
--- /dev/null
+++ b/src/web_accessible_resources/googlesyndication_adsbygoogle.js
@@ -0,0 +1,56 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2019-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+(function() {
+ 'use strict';
+ const init = ( ) => {
+ window.adsbygoogle = {
+ loaded: true,
+ push: function() {
+ }
+ };
+ const phs = document.querySelectorAll('.adsbygoogle');
+ const css = 'height:1px!important;max-height:1px!important;max-width:1px!important;width:1px!important;';
+ for ( let i = 0; i < phs.length; i++ ) {
+ const id = `aswift_${i}`;
+ if ( document.querySelector(`iframe#${id}`) !== null ) { continue; }
+ const fr = document.createElement('iframe');
+ fr.id = id;
+ fr.style = css;
+ const cfr = document.createElement('iframe');
+ cfr.id = `google_ads_frame${i}`;
+ fr.appendChild(cfr);
+ phs[i].appendChild(fr);
+ }
+ };
+ if (
+ document.querySelectorAll('.adsbygoogle').length === 0 &&
+ document.readyState === 'loading'
+ ) {
+ window.addEventListener('DOMContentLoaded', init, { once: true });
+ } else {
+ init();
+ }
+})();
+
+/*
+pagead2.googlesyndication.com/pagead/js/adsbygoogle.js,adsbygoogle-placeholder,adsbygoogleStatus,google_ad_channel,google_ad_client,google_ad_format,google_ad_frequency_hint,google_ad_height,google_ad_host,google_ad_host_channel,google_ad_modifications,google_ad_region,google_ad_resizable,google_ad_resize,google_ad_section,google_ad_semantic_area,google_ad_width,google_adbreak_test,google_ads_frame,google_ads_iframe,google_adtest,google_admob_interstitial_slot,google_admob_rewarded_slot,google_admob_ads_only,google-adsense-platform-account,google_adsense_settings,google_ama_config,google-ama-order-assurance,google_ama_settings,google_ama_state,google_apltlad,google_audio_sense,google-auto-placed-read-aloud-player-reserved,google_debug_params,google_full_width_responsive,google_full_width_responsive_allowed,google_image_requests,google_js_errors,google_js_reporting_queue,google_loader_features_used,google_llp,google_logging_queue,google_max_ad_content_rating,google_measure_js_timing,google_ml_rank,google_overlays,google_override_format,google_package,google_page_url,google_persistent_state_async,google_pgb_reactive,google_placement_id,google_prev_ad_formats_by_region,google_prev_ad_slotnames_by_region,google_reactive_ad_format,google_reactive_ads_global_state,google_resizing_height,google_resizing_width,google_responsive_auto_format,google_responsive_dummy_ad,google_responsive_formats,google_restrict_data_processing,google_rum_task_id_counter,google_safe_for_responsive_override,google_shadow_mode,google_srt,google_tag_for_under_age_of_consent,google_tag_origin,google_tag_partner,google_traffic_source,google_unique_id,googletag
+*/
diff --git a/src/web_accessible_resources/googletagmanager_gtm.js b/src/web_accessible_resources/googletagmanager_gtm.js
new file mode 100644
index 0000000..09f4658
--- /dev/null
+++ b/src/web_accessible_resources/googletagmanager_gtm.js
@@ -0,0 +1,43 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2019-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+(function() {
+ 'use strict';
+ const noopfn = function() {
+ };
+ const w = window;
+ w.ga = w.ga || noopfn;
+ const dl = w.dataLayer;
+ if ( dl instanceof Object === false ) { return; }
+ if ( dl.hide instanceof Object && typeof dl.hide.end === 'function' ) {
+ dl.hide.end();
+ }
+ if ( typeof dl.push === 'function' ) {
+ dl.push = function(o) {
+ if (
+ o instanceof Object &&
+ typeof o.eventCallback === 'function'
+ ) {
+ setTimeout(o.eventCallback, 1);
+ }
+ };
+ }
+})();
diff --git a/src/web_accessible_resources/googletagservices_gpt.js b/src/web_accessible_resources/googletagservices_gpt.js
new file mode 100644
index 0000000..b151936
--- /dev/null
+++ b/src/web_accessible_resources/googletagservices_gpt.js
@@ -0,0 +1,154 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2019-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+(function() {
+ 'use strict';
+ // https://developers.google.com/doubleclick-gpt/reference
+ const noopfn = function() {
+ }.bind();
+ const noopthisfn = function() {
+ return this;
+ };
+ const noopnullfn = function() {
+ return null;
+ };
+ const nooparrayfn = function() {
+ return [];
+ };
+ const noopstrfn = function() {
+ return '';
+ };
+ //
+ const companionAdsService = {
+ addEventListener: noopthisfn,
+ enableSyncLoading: noopfn,
+ setRefreshUnfilledSlots: noopfn
+ };
+ const contentService = {
+ addEventListener: noopthisfn,
+ setContent: noopfn
+ };
+ const PassbackSlot = function() {
+ };
+ let p = PassbackSlot.prototype;
+ p.display = noopfn;
+ p.get = noopnullfn;
+ p.set = noopthisfn;
+ p.setClickUrl = noopthisfn;
+ p.setTagForChildDirectedTreatment = noopthisfn;
+ p.setTargeting = noopthisfn;
+ p.updateTargetingFromMap = noopthisfn;
+ const pubAdsService = {
+ addEventListener: noopthisfn,
+ clear: noopfn,
+ clearCategoryExclusions: noopthisfn,
+ clearTagForChildDirectedTreatment: noopthisfn,
+ clearTargeting: noopthisfn,
+ collapseEmptyDivs: noopfn,
+ defineOutOfPagePassback: function() { return new PassbackSlot(); },
+ definePassback: function() { return new PassbackSlot(); },
+ disableInitialLoad: noopfn,
+ display: noopfn,
+ enableAsyncRendering: noopfn,
+ enableLazyLoad: noopfn,
+ enableSingleRequest: noopfn,
+ enableSyncRendering: noopfn,
+ enableVideoAds: noopfn,
+ get: noopnullfn,
+ getAttributeKeys: nooparrayfn,
+ getTargeting: nooparrayfn,
+ getTargetingKeys: nooparrayfn,
+ getSlots: nooparrayfn,
+ refresh: noopfn,
+ removeEventListener: noopfn,
+ set: noopthisfn,
+ setCategoryExclusion: noopthisfn,
+ setCentering: noopfn,
+ setCookieOptions: noopthisfn,
+ setForceSafeFrame: noopthisfn,
+ setLocation: noopthisfn,
+ setPublisherProvidedId: noopthisfn,
+ setPrivacySettings: noopthisfn,
+ setRequestNonPersonalizedAds: noopthisfn,
+ setSafeFrameConfig: noopthisfn,
+ setTagForChildDirectedTreatment: noopthisfn,
+ setTargeting: noopthisfn,
+ setVideoContent: noopthisfn,
+ updateCorrelator: noopfn
+ };
+ const SizeMappingBuilder = function() {
+ };
+ p = SizeMappingBuilder.prototype;
+ p.addSize = noopthisfn;
+ p.build = noopnullfn;
+ const Slot = function() {
+ };
+ p = Slot.prototype;
+ p.addService = noopthisfn;
+ p.clearCategoryExclusions = noopthisfn;
+ p.clearTargeting = noopthisfn;
+ p.defineSizeMapping = noopthisfn;
+ p.get = noopnullfn;
+ p.getAdUnitPath = nooparrayfn;
+ p.getAttributeKeys = nooparrayfn;
+ p.getCategoryExclusions = nooparrayfn;
+ p.getDomId = noopstrfn;
+ p.getResponseInformation = noopnullfn;
+ p.getSlotElementId = noopstrfn;
+ p.getSlotId = noopthisfn;
+ p.getTargeting = nooparrayfn;
+ p.getTargetingKeys = nooparrayfn;
+ p.set = noopthisfn;
+ p.setCategoryExclusion = noopthisfn;
+ p.setClickUrl = noopthisfn;
+ p.setCollapseEmptyDiv = noopthisfn;
+ p.setTargeting = noopthisfn;
+ p.updateTargetingFromMap = noopthisfn;
+ //
+ const gpt = window.googletag || {};
+ const cmd = gpt.cmd || [];
+ gpt.apiReady = true;
+ gpt.cmd = [];
+ gpt.cmd.push = function(a) {
+ try {
+ a();
+ } catch (ex) {
+ }
+ return 1;
+ };
+ gpt.companionAds = function() { return companionAdsService; };
+ gpt.content = function() { return contentService; };
+ gpt.defineOutOfPageSlot = function() { return new Slot(); };
+ gpt.defineSlot = function() { return new Slot(); };
+ gpt.destroySlots = noopfn;
+ gpt.disablePublisherConsole = noopfn;
+ gpt.display = noopfn;
+ gpt.enableServices = noopfn;
+ gpt.getVersion = noopstrfn;
+ gpt.pubads = function() { return pubAdsService; };
+ gpt.pubadsReady = true;
+ gpt.setAdIframeTitle = noopfn;
+ gpt.sizeMapping = function() { return new SizeMappingBuilder(); };
+ window.googletag = gpt;
+ while ( cmd.length !== 0 ) {
+ gpt.cmd.push(cmd.shift());
+ }
+})();
diff --git a/src/web_accessible_resources/hd-main.js b/src/web_accessible_resources/hd-main.js
new file mode 100644
index 0000000..149d603
--- /dev/null
+++ b/src/web_accessible_resources/hd-main.js
@@ -0,0 +1,46 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2019-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+(function() {
+ 'use strict';
+ const l = {};
+ const noopfn = function() {
+ };
+ const props = [
+ "$j","Ad","Bd","Cd","Dd","Ed","Fd","Gd","Hd","Id","Jd","Nj","Oc","Pc","Pe",
+ "Qc","Qe","Rc","Re","Ri","Sc","Tc","Uc","Vc","Wc","Wg","Xc","Xg","Yc","Yd",
+ "ad","ae","bd","bf","cd","dd","ed","ef","ek","fd","fg","fh","fk","gd","hd",
+ "ig","ij","jd","kd","ke","ld","md","mi","nd","od","oh","pd","pf","qd","rd",
+ "sd","td","ud","vd","wd","wg","xd","xh","yd","zd",
+ "$d","$e","$k","Ae","Af","Aj","Be","Ce","De","Ee","Ek","Eo","Ep","Fe","Fo",
+ "Ge","Gh","Hk","Ie","Ip","Je","Ke","Kk","Kq","Le","Lh","Lk","Me","Mm","Ne",
+ "Oe","Pe","Qe","Re","Rp","Se","Te","Ue","Ve","Vp","We","Xd","Xe","Yd","Ye",
+ "Zd","Ze","Zf","Zk","ae","af","al","be","bf","bg","ce","cp","df","di","ee",
+ "ef","fe","ff","gf","gm","he","hf","ie","je","jf","ke","kf","kl","le","lf",
+ "lk","mf","mg","mn","nf","oe","of","pe","pf","pg","qe","qf","re","rf","se",
+ "sf","te","tf","ti","ue","uf","ve","vf","we","wf","wg","wi","xe","ye","yf",
+ "yk","yl","ze","zf","zk"
+ ];
+ for ( let i = 0; i < props.length; i++ ) {
+ l[props[i]] = noopfn;
+ }
+ window.L = window.J = l;
+})();
diff --git a/src/web_accessible_resources/nobab.js b/src/web_accessible_resources/nobab.js
new file mode 100644
index 0000000..32a2983
--- /dev/null
+++ b/src/web_accessible_resources/nobab.js
@@ -0,0 +1,87 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2019-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+(function() {
+ 'use strict';
+ const signatures = [
+ [ 'blockadblock' ],
+ [ 'babasbm' ],
+ [ /getItem\('babn'\)/ ],
+ [
+ 'getElementById',
+ 'String.fromCharCode',
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
+ 'charAt',
+ 'DOMContentLoaded',
+ 'AdBlock',
+ 'addEventListener',
+ 'doScroll',
+ 'fromCharCode',
+ '<<2|r>>4',
+ 'sessionStorage',
+ 'clientWidth',
+ 'localStorage',
+ 'Math',
+ 'random'
+ ],
+ ];
+ const check = function(s) {
+ for ( let i = 0; i < signatures.length; i++ ) {
+ const tokens = signatures[i];
+ let match = 0;
+ for ( let j = 0; j < tokens.length; j++ ) {
+ const token = tokens[j];
+ const pos = token instanceof RegExp
+ ? s.search(token)
+ : s.indexOf(token);
+ if ( pos !== -1 ) { match += 1; }
+ }
+ if ( (match / tokens.length) >= 0.8 ) { return true; }
+ }
+ return false;
+ };
+ window.eval = new Proxy(window.eval, { // jshint ignore: line
+ apply: function(target, thisArg, args) {
+ const a = args[0];
+ if ( typeof a !== 'string' || !check(a) ) {
+ return target.apply(thisArg, args);
+ }
+ if ( document.body ) {
+ document.body.style.removeProperty('visibility');
+ }
+ let el = document.getElementById('babasbmsgx');
+ if ( el ) {
+ el.parentNode.removeChild(el);
+ }
+ }
+ });
+ window.setTimeout = new Proxy(window.setTimeout, {
+ apply: function(target, thisArg, args) {
+ const a = args[0];
+ if (
+ typeof a !== 'string' ||
+ /\.bab_elementid.$/.test(a) === false
+ ) {
+ return target.apply(thisArg, args);
+ }
+ }
+ });
+})();
diff --git a/src/web_accessible_resources/nobab2.js b/src/web_accessible_resources/nobab2.js
new file mode 100644
index 0000000..ea3b210
--- /dev/null
+++ b/src/web_accessible_resources/nobab2.js
@@ -0,0 +1,42 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2021-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+(function() {
+ 'use strict';
+ const script = document.currentScript;
+ if ( script === null ) { return; }
+ const src = script.src;
+ if ( typeof src !== 'string' ) { return; }
+ // The scriplet is meant to act ONLY when it's being used as a redirection
+ // for specific domains.
+ const re = new RegExp(
+ '^https?://[\\w-]+\\.(' +
+ [
+ 'adclixx\\.net',
+ 'adnetasia\\.com',
+ 'adtrackers\\.net',
+ 'bannertrack\\.net',
+ ].join('|') +
+ ')/.'
+ );
+ if ( re.test(src) === false ) { return; }
+ window.nH7eXzOsG = 858;
+})();
diff --git a/src/web_accessible_resources/noeval-silent.js b/src/web_accessible_resources/noeval-silent.js
new file mode 100644
index 0000000..cfe6e3b
--- /dev/null
+++ b/src/web_accessible_resources/noeval-silent.js
@@ -0,0 +1,28 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2019-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+(function() {
+ 'use strict';
+ window.eval = new Proxy(window.eval, { // jshint ignore: line
+ apply: function() {
+ }
+ });
+})();
diff --git a/src/web_accessible_resources/noeval.js b/src/web_accessible_resources/noeval.js
new file mode 100644
index 0000000..e1f2a74
--- /dev/null
+++ b/src/web_accessible_resources/noeval.js
@@ -0,0 +1,30 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2019-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+(function() {
+ 'use strict';
+ const log = console.log.bind(console);
+ window.eval = new Proxy(window.eval, { // jshint ignore: line
+ apply: function(target, thisArg, args) {
+ log(`Document tried to eval... ${args[0]}\n`);
+ }
+ });
+})();
diff --git a/src/web_accessible_resources/nofab.js b/src/web_accessible_resources/nofab.js
new file mode 100644
index 0000000..9e50e0b
--- /dev/null
+++ b/src/web_accessible_resources/nofab.js
@@ -0,0 +1,67 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2019-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+(function() {
+ 'use strict';
+ const noopfn = function() {
+ };
+ const Fab = function() {};
+ Fab.prototype.check = noopfn;
+ Fab.prototype.clearEvent = noopfn;
+ Fab.prototype.emitEvent = noopfn;
+ Fab.prototype.on = function(a, b) {
+ if ( !a ) { b(); }
+ return this;
+ };
+ Fab.prototype.onDetected = function() {
+ return this;
+ };
+ Fab.prototype.onNotDetected = function(a) {
+ a();
+ return this;
+ };
+ Fab.prototype.setOption = noopfn;
+ Fab.prototype.options = {
+ set: noopfn,
+ get: noopfn,
+ };
+ const fab = new Fab();
+ const getSetFab = {
+ get: function() { return Fab; },
+ set: function() {}
+ };
+ const getsetfab = {
+ get: function() { return fab; },
+ set: function() {}
+ };
+ if ( window.hasOwnProperty('FuckAdBlock') ) { window.FuckAdBlock = Fab; }
+ else { Object.defineProperty(window, 'FuckAdBlock', getSetFab); }
+ if ( window.hasOwnProperty('BlockAdBlock') ) { window.BlockAdBlock = Fab; }
+ else { Object.defineProperty(window, 'BlockAdBlock', getSetFab); }
+ if ( window.hasOwnProperty('SniffAdBlock') ) { window.SniffAdBlock = Fab; }
+ else { Object.defineProperty(window, 'SniffAdBlock', getSetFab); }
+ if ( window.hasOwnProperty('fuckAdBlock') ) { window.fuckAdBlock = fab; }
+ else { Object.defineProperty(window, 'fuckAdBlock', getsetfab); }
+ if ( window.hasOwnProperty('blockAdBlock') ) { window.blockAdBlock = fab; }
+ else { Object.defineProperty(window, 'blockAdBlock', getsetfab); }
+ if ( window.hasOwnProperty('sniffAdBlock') ) { window.sniffAdBlock = fab; }
+ else { Object.defineProperty(window, 'sniffAdBlock', getsetfab); }
+})();
diff --git a/src/web_accessible_resources/noop-0.1s.mp3 b/src/web_accessible_resources/noop-0.1s.mp3
new file mode 100644
index 0000000..147d71b
--- /dev/null
+++ b/src/web_accessible_resources/noop-0.1s.mp3
Binary files differ
diff --git a/src/web_accessible_resources/noop-0.5s.mp3 b/src/web_accessible_resources/noop-0.5s.mp3
new file mode 100644
index 0000000..b82866b
--- /dev/null
+++ b/src/web_accessible_resources/noop-0.5s.mp3
Binary files differ
diff --git a/src/web_accessible_resources/noop-1s.mp4 b/src/web_accessible_resources/noop-1s.mp4
new file mode 100644
index 0000000..5689d4a
--- /dev/null
+++ b/src/web_accessible_resources/noop-1s.mp4
Binary files differ
diff --git a/src/web_accessible_resources/noop-vmap1.0.xml b/src/web_accessible_resources/noop-vmap1.0.xml
new file mode 100644
index 0000000..acd6fb8
--- /dev/null
+++ b/src/web_accessible_resources/noop-vmap1.0.xml
@@ -0,0 +1 @@
+<vmap:VMAP xmlns:vmap="http://www.iab.net/videosuite/vmap" version="1.0"></vmap:VMAP>
diff --git a/src/web_accessible_resources/noop.css b/src/web_accessible_resources/noop.css
new file mode 100644
index 0000000..79a9626
--- /dev/null
+++ b/src/web_accessible_resources/noop.css
@@ -0,0 +1 @@
+/* */
diff --git a/src/web_accessible_resources/noop.html b/src/web_accessible_resources/noop.html
new file mode 100644
index 0000000..8aaae14
--- /dev/null
+++ b/src/web_accessible_resources/noop.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<html>
+ <head><title></title></head>
+ <body></body>
+</html>
diff --git a/src/web_accessible_resources/noop.js b/src/web_accessible_resources/noop.js
new file mode 100644
index 0000000..b977b08
--- /dev/null
+++ b/src/web_accessible_resources/noop.js
@@ -0,0 +1,3 @@
+(function() {
+ 'use strict';
+})();
diff --git a/src/web_accessible_resources/noop.json b/src/web_accessible_resources/noop.json
new file mode 100644
index 0000000..9e26dfe
--- /dev/null
+++ b/src/web_accessible_resources/noop.json
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/src/web_accessible_resources/noop.txt b/src/web_accessible_resources/noop.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/src/web_accessible_resources/noop.txt
@@ -0,0 +1 @@
+
diff --git a/src/web_accessible_resources/outbrain-widget.js b/src/web_accessible_resources/outbrain-widget.js
new file mode 100644
index 0000000..10ba605
--- /dev/null
+++ b/src/web_accessible_resources/outbrain-widget.js
@@ -0,0 +1,72 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2019-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+(function() {
+ 'use strict';
+ const noopfn = function() {
+ };
+ const obr = {};
+ const methods = [
+ 'callClick',
+ 'callLoadMore',
+ 'callRecs',
+ 'callUserZapping',
+ 'callWhatIs',
+ 'cancelRecommendation',
+ 'cancelRecs',
+ 'closeCard',
+ 'closeModal',
+ 'closeTbx',
+ 'errorInjectionHandler',
+ 'getCountOfRecs',
+ 'getStat',
+ 'imageError',
+ 'manualVideoClicked',
+ 'onOdbReturn',
+ 'onVideoClick',
+ 'pagerLoad',
+ 'recClicked',
+ 'refreshSpecificWidget',
+ 'renderSpaWidgets',
+ 'refreshWidget',
+ 'reloadWidget',
+ 'researchWidget',
+ 'returnedError',
+ 'returnedHtmlData',
+ 'returnedIrdData',
+ 'returnedJsonData',
+ 'scrollLoad',
+ 'showDescription',
+ 'showRecInIframe',
+ 'userZappingMessage',
+ 'zappingFormAction'
+ ];
+ obr.extern = {
+ video: {
+ getVideoRecs: noopfn,
+ videoClicked: noopfn
+ }
+ };
+ methods.forEach(function(a) {
+ obr.extern[a] = noopfn;
+ });
+ window.OBR = window.OBR || obr;
+})();
diff --git a/src/web_accessible_resources/popads-dummy.js b/src/web_accessible_resources/popads-dummy.js
new file mode 100644
index 0000000..0ca0b1e
--- /dev/null
+++ b/src/web_accessible_resources/popads-dummy.js
@@ -0,0 +1,30 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2019-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+(function() {
+ 'use strict';
+ delete window.PopAds;
+ delete window.popns;
+ Object.defineProperties(window, {
+ PopAds: { value: {} },
+ popns: { value: {} }
+ });
+})();
diff --git a/src/web_accessible_resources/popads.js b/src/web_accessible_resources/popads.js
new file mode 100644
index 0000000..df86e97
--- /dev/null
+++ b/src/web_accessible_resources/popads.js
@@ -0,0 +1,40 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2019-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+(function() {
+ 'use strict';
+ const magic = String.fromCharCode(Date.now() % 26 + 97) +
+ Math.floor(Math.random() * 982451653 + 982451653).toString(36);
+ const oe = window.onerror;
+ window.onerror = function(msg, src, line, col, error) {
+ if ( typeof msg === 'string' && msg.indexOf(magic) !== -1 ) { return true; }
+ if ( oe instanceof Function ) {
+ return oe(msg, src, line, col, error);
+ }
+ }.bind();
+ const throwMagic = function() { throw new ReferenceError(magic); };
+ delete window.PopAds;
+ delete window.popns;
+ Object.defineProperties(window, {
+ PopAds: { set: throwMagic },
+ popns: { set: throwMagic }
+ });
+})();
diff --git a/src/web_accessible_resources/prebid-ads.js b/src/web_accessible_resources/prebid-ads.js
new file mode 100644
index 0000000..f3b2dc6
--- /dev/null
+++ b/src/web_accessible_resources/prebid-ads.js
@@ -0,0 +1,26 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2022-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+(function() {
+ 'use strict';
+ window.canRunAds = true;
+ window.isAdBlockActive = false;
+})();
diff --git a/src/web_accessible_resources/scorecardresearch_beacon.js b/src/web_accessible_resources/scorecardresearch_beacon.js
new file mode 100644
index 0000000..5ca7203
--- /dev/null
+++ b/src/web_accessible_resources/scorecardresearch_beacon.js
@@ -0,0 +1,31 @@
+/*******************************************************************************
+
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2019-present Raymond Hill
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see {http://www.gnu.org/licenses/}.
+
+ Home: https://github.com/gorhill/uBlock
+*/
+
+(function() {
+ 'use strict';
+ window.COMSCORE = {
+ purge: function() {
+ window._comscore = [];
+ },
+ beacon: function() {
+ }
+ };
+})();