Fix infinitely appending style property

Related issue:
- https://github.com/NanoAdblocker/NanoCore/issues/348
This commit is contained in:
Raymond Hill 2020-07-03 15:07:52 -04:00
parent d1715fb19f
commit a5ba668c38
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 5 additions and 5 deletions

View File

@ -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;');
}