From 7c3d49c0051dc1d5a7be71acd9f08f8b3b09b901 Mon Sep 17 00:00:00 2001 From: eight Date: Sat, 13 Oct 2018 17:50:28 +0800 Subject: [PATCH] Fix: ROOT may change in XML pages --- content/apply.js | 3 ++- manifest.json | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/apply.js b/content/apply.js index c3fd540c..a399d61d 100644 --- a/content/apply.js +++ b/content/apply.js @@ -8,7 +8,7 @@ const APPLY = (() => { const CHROME = chrome.app ? parseInt(navigator.userAgent.match(/Chrom\w+\/(?:\d+\.){2}(\d+)|$/)[1]) : NaN; var ID_PREFIX = 'stylus-'; - var ROOT = document.documentElement; + var ROOT; var isOwnPage = location.protocol.endsWith('-extension:'); var disableAll = false; var styleElements = new Map(); @@ -43,6 +43,7 @@ const APPLY = (() => { } return API.getSectionsByUrl(getMatchUrl()) .then(result => { + ROOT = document.documentElement; const styles = Object.values(result); // CSS transition bug workaround: since we insert styles asynchronously, // the browsers, especially Firefox, may apply all transitions on page load diff --git a/manifest.json b/manifest.json index 0550b064..c7020297 100644 --- a/manifest.json +++ b/manifest.json @@ -29,7 +29,6 @@ "js/storage-util.js", "js/sections-util.js", "js/worker-util.js", - "background/storage.js", "js/prefs.js", "js/script-loader.js", "js/usercss.js",