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,12 +365,12 @@ vAPI.DOMFilterer = class {
let attr = node.getAttribute('style'); let attr = node.getAttribute('style');
if ( attr === null ) { if ( attr === null ) {
attr = ''; attr = '';
} else if ( } else if ( attr.length !== 0 ) {
attr.length !== 0 && if ( attr.endsWith('display:none!important;') ) { continue; }
attr.charCodeAt(attr.length - 1) !== 0x3B /* ';' */ if ( attr.charCodeAt(attr.length - 1) !== 0x3B /* ';' */ ) {
) {
attr += ';'; attr += ';';
} }
}
node.setAttribute('style', attr + 'display:none!important;'); node.setAttribute('style', attr + 'display:none!important;');
} }
this.hiddenNodesetToProcess.clear(); this.hiddenNodesetToProcess.clear();