mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-02 23:57:10 +02:00
Trim end of class tokens in generic cosmetic filtering's surveyor
Related issue: https://github.com/uBlockOrigin/uBlock-issues/issues/3257
This commit is contained in:
parent
ce7806e3f1
commit
8ea1bac80b
@ -89,8 +89,10 @@ const uBOL_classesFromNode = (node, out) => {
|
|||||||
end = s.indexOf(' ', beg);
|
end = s.indexOf(' ', beg);
|
||||||
if ( end === beg ) { continue; }
|
if ( end === beg ) { continue; }
|
||||||
if ( end === -1 ) { end = len; }
|
if ( end === -1 ) { end = len; }
|
||||||
out.push(hashFromStr(0x2E /* '.' */, s.slice(beg, end)));
|
const token = s.slice(beg, end).trimEnd();
|
||||||
beg = end;
|
beg = end;
|
||||||
|
if ( token.length === 0 ) { continue; }
|
||||||
|
out.push(hashFromStr(0x2E /* '.' */, token));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1016,8 +1016,10 @@ vAPI.DOMFilterer = class {
|
|||||||
end = s.indexOf(' ', beg);
|
end = s.indexOf(' ', beg);
|
||||||
if ( end === beg ) { continue; }
|
if ( end === beg ) { continue; }
|
||||||
if ( end === -1 ) { end = len; }
|
if ( end === -1 ) { end = len; }
|
||||||
const hash = hashFromStr(0x2E /* '.' */, s.slice(beg, end));
|
const token = s.slice(beg, end).trimEnd();
|
||||||
beg = end;
|
beg = end;
|
||||||
|
if ( token.length === 0 ) { continue; }
|
||||||
|
const hash = hashFromStr(0x2E /* '.' */, token);
|
||||||
if ( queriedHashes.has(hash) ) { continue; }
|
if ( queriedHashes.has(hash) ) { continue; }
|
||||||
queriedHashes.add(hash);
|
queriedHashes.add(hash);
|
||||||
out.push(hash);
|
out.push(hash);
|
||||||
|
Loading…
Reference in New Issue
Block a user