mirror of https://github.com/gorhill/uBlock.git
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);
|
||||
if ( end === beg ) { continue; }
|
||||
if ( end === -1 ) { end = len; }
|
||||
out.push(hashFromStr(0x2E /* '.' */, s.slice(beg, end)));
|
||||
const token = s.slice(beg, end).trimEnd();
|
||||
beg = end;
|
||||
if ( token.length === 0 ) { continue; }
|
||||
out.push(hashFromStr(0x2E /* '.' */, token));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1016,8 +1016,10 @@ vAPI.DOMFilterer = class {
|
|||
end = s.indexOf(' ', beg);
|
||||
if ( end === beg ) { continue; }
|
||||
if ( end === -1 ) { end = len; }
|
||||
const hash = hashFromStr(0x2E /* '.' */, s.slice(beg, end));
|
||||
const token = s.slice(beg, end).trimEnd();
|
||||
beg = end;
|
||||
if ( token.length === 0 ) { continue; }
|
||||
const hash = hashFromStr(0x2E /* '.' */, token);
|
||||
if ( queriedHashes.has(hash) ) { continue; }
|
||||
queriedHashes.add(hash);
|
||||
out.push(hash);
|
||||
|
|
Loading…
Reference in New Issue