From b6703e7b15de1785d09aa364cbc75c8d99feaa42 Mon Sep 17 00:00:00 2001 From: tophf Date: Mon, 13 Nov 2017 20:15:53 +0300 Subject: [PATCH] fix disableAll in XML documents: tag names are case-sensitive in XML --- content/apply.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/apply.js b/content/apply.js index 9b8c3213..ef47be7b 100644 --- a/content/apply.js +++ b/content/apply.js @@ -111,7 +111,7 @@ function doDisableAll(disable = disableAll) { } disableAll = disable; Array.prototype.forEach.call(document.styleSheets, stylesheet => { - if (stylesheet.ownerNode.matches(`STYLE.stylus[id^="${ID_PREFIX}"]`) + if (stylesheet.ownerNode.matches(`style.stylus[id^="${ID_PREFIX}"]`) && stylesheet.disabled !== disable) { stylesheet.disabled = disable; } @@ -263,7 +263,7 @@ function addStyleElement(el) { function replaceAll(newStyles) { const oldStyles = Array.prototype.slice.call( - document.querySelectorAll(`STYLE.stylus[id^="${ID_PREFIX}"]`)); + document.querySelectorAll(`style.stylus[id^="${ID_PREFIX}"]`)); oldStyles.forEach(el => (el.id += '-ghost')); styleElements.clear(); disabledElements.clear();