Skip to content

Commit a5ba668

Browse files
committed
Fix infinitely appending style property
Related issue: - NanoAdblocker#348
1 parent d1715fb commit a5ba668

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

platform/chromium/vapi-usercss.pseudo.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,11 +365,11 @@ vAPI.DOMFilterer = class {
365365
let attr = node.getAttribute('style');
366366
if ( attr === null ) {
367367
attr = '';
368-
} else if (
369-
attr.length !== 0 &&
370-
attr.charCodeAt(attr.length - 1) !== 0x3B /* ';' */
371-
) {
372-
attr += ';';
368+
} else if ( attr.length !== 0 ) {
369+
if ( attr.endsWith('display:none!important;') ) { continue; }
370+
if ( attr.charCodeAt(attr.length - 1) !== 0x3B /* ';' */ ) {
371+
attr += ';';
372+
}
373373
}
374374
node.setAttribute('style', attr + 'display:none!important;');
375375
}

0 commit comments

Comments
 (0)