From c83b6776daa20d3d864be2e037d613ef37960caf Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Wed, 20 Feb 2019 07:18:37 -0500 Subject: [PATCH] Remove support for implicit scriptlet injection Related issue: - https://github.com/gorhill/uBlock/issues/3550 --- src/js/scriptlet-filtering.js | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/src/js/scriptlet-filtering.js b/src/js/scriptlet-filtering.js index 57441bf8e..038079e1e 100644 --- a/src/js/scriptlet-filtering.js +++ b/src/js/scriptlet-filtering.js @@ -323,22 +323,7 @@ const domain = request.domain; const entity = request.entity; - // https://github.com/gorhill/uBlock/issues/1954 - // Implicit - let hn = hostname; - for (;;) { - lookupScriptlet(hn + '.js', reng, scriptletsRegister); - if ( hn === domain ) { break; } - const pos = hn.indexOf('.'); - if ( pos === -1 ) { break; } - hn = hn.slice(pos + 1); - } - if ( entity !== '' ) { - lookupScriptlet(entity + '.js', reng, scriptletsRegister); - } - - // Explicit - let entries = []; + const entries = []; const domainHash = µb.staticExtFilteringEngine.makeHash(domain); if ( domainHash !== 0 ) { scriptletDB.retrieve(domainHash, hostname, entries); @@ -355,7 +340,7 @@ if ( scriptletsRegister.size === 0 ) { return; } // Collect exception filters. - entries = []; + entries.length = 0; if ( domainHash !== 0 ) { scriptletDB.retrieve(domainHash | 0b0001, hostname, entries); }