diff --git a/assets/resources/scriptlets.js b/assets/resources/scriptlets.js index 86caa8f68..ba7d2dea3 100644 --- a/assets/resources/scriptlets.js +++ b/assets/resources/scriptlets.js @@ -1554,25 +1554,6 @@ })(); -// https://github.com/uBlockOrigin/uAssets/issues/2912 -/// fingerprint2.js -(function() { - let browserId = ''; - for ( let i = 0; i < 8; i++ ) { - browserId += (Math.random() * 0x10000 + 0x1000 | 0).toString(16).slice(-4); - } - const fp2 = function(){}; - fp2.get = function(opts, cb) { - if ( !cb ) { cb = opts; } - setTimeout(( ) => { cb(browserId, []); }, 1); - }; - fp2.prototype = { - get: fp2.get - }; - window.Fingerprint2 = fp2; -})(); - - // https://github.com/NanoAdblocker/NanoFilters/issues/149 /// cookie-remover.js (function() { diff --git a/src/js/redirect-engine.js b/src/js/redirect-engine.js index d234613bf..25959c6ea 100644 --- a/src/js/redirect-engine.js +++ b/src/js/redirect-engine.js @@ -80,6 +80,9 @@ const redirectableResources = new Map([ [ 'empty', { data: 'text', // Important! } ], + [ 'fingerprint2.js', { + data: 'text', + } ], [ 'google-analytics_analytics.js', { alias: [ 'google-analytics.com/analytics.js', diff --git a/src/web_accessible_resources/fingerprint2.js b/src/web_accessible_resources/fingerprint2.js new file mode 100644 index 000000000..91c589722 --- /dev/null +++ b/src/web_accessible_resources/fingerprint2.js @@ -0,0 +1,37 @@ +/******************************************************************************* + + 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 +*/ + +(function() { + 'use strict'; + let browserId = ''; + for ( let i = 0; i < 8; i++ ) { + browserId += (Math.random() * 0x10000 + 0x1000 | 0).toString(16).slice(-4); + } + const fp2 = function(){}; + fp2.get = function(opts, cb) { + if ( !cb ) { cb = opts; } + setTimeout(( ) => { cb(browserId, []); }, 1); + }; + fp2.prototype = { + get: fp2.get + }; + window.Fingerprint2 = fp2; +})();