mirror of https://github.com/gorhill/uBlock.git
Fix mishandling of procedural cosmetic exceptions in logger
Issue reported by @uBlock-user in team channel. Creating cosmetic procedural exception filters was causing `cosmetic-logger.js` scriptlet to throw at and thus further breaking the logging of cosmetic filters overall.
This commit is contained in:
parent
e393a52442
commit
97d6d5028b
|
@ -254,12 +254,18 @@ const handlers = {
|
||||||
if ( Array.isArray(changes.exceptions) ) {
|
if ( Array.isArray(changes.exceptions) ) {
|
||||||
for ( const selector of changes.exceptions ) {
|
for ( const selector of changes.exceptions ) {
|
||||||
if ( loggedSelectors.has(selector) ) { continue; }
|
if ( loggedSelectors.has(selector) ) { continue; }
|
||||||
if ( selector.charCodeAt(0) === 0x7B /* '{' */ ) {
|
if ( selector.charCodeAt(0) !== 0x7B /* '{' */ ) {
|
||||||
const details = JSON.parse(selector);
|
|
||||||
exceptionDict.set(details.style[0], details.raw);
|
|
||||||
} else {
|
|
||||||
exceptionDict.set(selector, selector);
|
exceptionDict.set(selector, selector);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
const details = JSON.parse(selector);
|
||||||
|
if ( Array.isArray(details.style) ) {
|
||||||
|
exceptionDict.set(details.style[0], details.raw);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// TODO:
|
||||||
|
// Handling of procedural cosmetic exception filters
|
||||||
|
// not implemented.
|
||||||
}
|
}
|
||||||
exceptionStr = undefined;
|
exceptionStr = undefined;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue