1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-14 23:12:28 +02:00

Remove support for implicit scriptlet injection

Related issue:
- https://github.com/gorhill/uBlock/issues/3550
This commit is contained in:
Raymond Hill 2019-02-20 07:18:37 -05:00
parent b585518c00
commit c83b6776da
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -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);
}