From a5ba668c382a3be0ba41ce0f0a69ebb090c260a5 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Fri, 3 Jul 2020 15:07:52 -0400 Subject: [PATCH] Fix infinitely appending style property Related issue: - https://github.com/NanoAdblocker/NanoCore/issues/348 --- platform/chromium/vapi-usercss.pseudo.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platform/chromium/vapi-usercss.pseudo.js b/platform/chromium/vapi-usercss.pseudo.js index dbf55b72f4b1e..4d0fda69f35cd 100644 --- a/platform/chromium/vapi-usercss.pseudo.js +++ b/platform/chromium/vapi-usercss.pseudo.js @@ -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;'); }