diff --git a/src/js/scriptlet-filtering.js b/src/js/scriptlet-filtering.js index 4c01ed3f2340a..4ef2d50f3edd8 100644 --- a/src/js/scriptlet-filtering.js +++ b/src/js/scriptlet-filtering.js @@ -369,10 +369,6 @@ scriptletFilteringEngine.retrieve = function(request, options = {}) { return out.join('\n'); }; -scriptletFilteringEngine.hasScriptlet = function(hostname, exceptionBit, scriptlet) { - return scriptletDB.hasStr(hostname, exceptionBit, scriptlet); -}; - scriptletFilteringEngine.injectNow = function(details) { if ( typeof details.frameId !== 'number' ) { return; } const request = { diff --git a/src/js/static-ext-filtering-db.js b/src/js/static-ext-filtering-db.js index 8669e4e9e43e2..4f3696cfc4185 100644 --- a/src/js/static-ext-filtering-db.js +++ b/src/js/static-ext-filtering-db.js @@ -122,34 +122,6 @@ const StaticExtFilteringHostnameDB = class { } } - hasStr(hostname, exceptionBit, value) { - let found = false; - for (;;) { - let iHn = this.hostnameToSlotIdMap.get(hostname); - if ( iHn !== undefined ) { - do { - const strId = this.hostnameSlots[iHn+0]; - const str = this.strSlots[strId >>> this.nBits]; - if ( (strId & exceptionBit) !== 0 ) { - if ( str === value || str === '' ) { return false; } - } - if ( str === value ) { found = true; } - iHn = this.hostnameSlots[iHn+1]; - } while ( iHn !== 0 ); - } - if ( hostname === '' ) { break; } - const pos = hostname.indexOf('.'); - if ( pos !== -1 ) { - hostname = hostname.slice(pos + 1); - } else if ( hostname !== '*' ) { - hostname = '*'; - } else { - hostname = ''; - } - } - return found; - } - toSelfie() { return { hostnameToSlotIdMap: Array.from(this.hostnameToSlotIdMap), diff --git a/src/js/traffic.js b/src/js/traffic.js index a653d036867ab..b1b930edd3df9 100644 --- a/src/js/traffic.js +++ b/src/js/traffic.js @@ -61,9 +61,6 @@ window.addEventListener('webextFlavor', function() { vAPI.webextFlavor.soup.has('firefox'); }, { once: true }); -// https://github.com/uBlockOrigin/uBlock-issues/issues/1553 -const supportsFloc = document.interestCohort instanceof Function; - /******************************************************************************/ const patchLocalRedirectURL = url => url.charCodeAt(0) === 0x2F /* '/' */ @@ -562,9 +559,6 @@ const onHeadersReceived = function(details) { if ( injectCSP(fctxt, pageStore, responseHeaders) === true ) { modifiedHeaders = true; } - if ( supportsFloc && foilFloc(fctxt, responseHeaders) ) { - modifiedHeaders = true; - } // https://bugzilla.mozilla.org/show_bug.cgi?id=1376932 // Prevent document from being cached by the browser if we modified it, @@ -1012,23 +1006,6 @@ const injectCSP = function(fctxt, pageStore, responseHeaders) { /******************************************************************************/ -// https://github.com/uBlockOrigin/uBlock-issues/issues/1553 -// https://github.com/WICG/floc#opting-out-of-computation - -const foilFloc = function(fctxt, responseHeaders) { - const hn = fctxt.getHostname(); - if ( scriptletFilteringEngine.hasScriptlet(hn, 1, 'no-floc') === false ) { - return false; - } - responseHeaders.push({ - name: 'Permissions-Policy', - value: 'interest-cohort=()' } - ); - return true; -}; - -/******************************************************************************/ - // https://github.com/gorhill/uBlock/issues/1163 // "Block elements by size". // https://github.com/gorhill/uBlock/issues/1390#issuecomment-187310719