From e8bfc9a03106c47d9e4a4670b024ac9a848bc746 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 29 Jan 2022 08:40:47 -0500 Subject: [PATCH] Add canrunads.js as redirectable resource Related discussion: - https://github.com/uBlockOrigin/uAssets/commit/036e13101ea60a14b4a416f47609793da7434b16#commitcomment-65068100 --- src/js/redirect-engine.js | 3 +++ src/web_accessible_resources/canrunads.js | 25 +++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 src/web_accessible_resources/canrunads.js diff --git a/src/js/redirect-engine.js b/src/js/redirect-engine.js index bd5f5154d..0ec5d0d71 100644 --- a/src/js/redirect-engine.js +++ b/src/js/redirect-engine.js @@ -67,6 +67,9 @@ const redirectableResources = new Map([ [ 'ampproject_v0.js', { alias: 'ampproject.org/v0.js', } ], + [ 'canrunads.js', { + data: 'text', + } ], [ 'chartbeat.js', { alias: 'static.chartbeat.com/chartbeat.js', } ], diff --git a/src/web_accessible_resources/canrunads.js b/src/web_accessible_resources/canrunads.js new file mode 100644 index 000000000..5ced617dd --- /dev/null +++ b/src/web_accessible_resources/canrunads.js @@ -0,0 +1,25 @@ +/******************************************************************************* + + 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; +})();