Fix: ROOT may change in XML pages
This commit is contained in:
parent
3fd8d937f3
commit
7c3d49c005
|
@ -8,7 +8,7 @@
|
||||||
const APPLY = (() => {
|
const APPLY = (() => {
|
||||||
const CHROME = chrome.app ? parseInt(navigator.userAgent.match(/Chrom\w+\/(?:\d+\.){2}(\d+)|$/)[1]) : NaN;
|
const CHROME = chrome.app ? parseInt(navigator.userAgent.match(/Chrom\w+\/(?:\d+\.){2}(\d+)|$/)[1]) : NaN;
|
||||||
var ID_PREFIX = 'stylus-';
|
var ID_PREFIX = 'stylus-';
|
||||||
var ROOT = document.documentElement;
|
var ROOT;
|
||||||
var isOwnPage = location.protocol.endsWith('-extension:');
|
var isOwnPage = location.protocol.endsWith('-extension:');
|
||||||
var disableAll = false;
|
var disableAll = false;
|
||||||
var styleElements = new Map();
|
var styleElements = new Map();
|
||||||
|
@ -43,6 +43,7 @@ const APPLY = (() => {
|
||||||
}
|
}
|
||||||
return API.getSectionsByUrl(getMatchUrl())
|
return API.getSectionsByUrl(getMatchUrl())
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
ROOT = document.documentElement;
|
||||||
const styles = Object.values(result);
|
const styles = Object.values(result);
|
||||||
// CSS transition bug workaround: since we insert styles asynchronously,
|
// CSS transition bug workaround: since we insert styles asynchronously,
|
||||||
// the browsers, especially Firefox, may apply all transitions on page load
|
// the browsers, especially Firefox, may apply all transitions on page load
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
"js/storage-util.js",
|
"js/storage-util.js",
|
||||||
"js/sections-util.js",
|
"js/sections-util.js",
|
||||||
"js/worker-util.js",
|
"js/worker-util.js",
|
||||||
"background/storage.js",
|
|
||||||
"js/prefs.js",
|
"js/prefs.js",
|
||||||
"js/script-loader.js",
|
"js/script-loader.js",
|
||||||
"js/usercss.js",
|
"js/usercss.js",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user