Skip to content

Commit

Permalink
Fix infinitely appending style property
Browse files Browse the repository at this point in the history
Related issue:
- NanoAdblocker#348
  • Loading branch information
gorhill committed Jul 3, 2020
1 parent d1715fb commit a5ba668
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions platform/chromium/vapi-usercss.pseudo.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,11 @@ vAPI.DOMFilterer = class {
let attr = node.getAttribute('style');
if ( attr === null ) {
attr = '';
} else if (
attr.length !== 0 &&
attr.charCodeAt(attr.length - 1) !== 0x3B /* ';' */
) {
attr += ';';
} else if ( attr.length !== 0 ) {
if ( attr.endsWith('display:none!important;') ) { continue; }
if ( attr.charCodeAt(attr.length - 1) !== 0x3B /* ';' */ ) {
attr += ';';
}
}
node.setAttribute('style', attr + 'display:none!important;');
}
Expand Down

0 comments on commit a5ba668

Please sign in to comment.