Fix: ROOT may change in XML pages

This commit is contained in:
eight 2018-10-13 17:50:28 +08:00
parent 3fd8d937f3
commit 7c3d49c005
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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",