autosort style elements on own pages too

This commit is contained in:
tophf 2020-10-05 21:08:30 +03:00
parent 15d854f913
commit 7c89f7b21d

View File

@ -8,7 +8,6 @@ self.createStyleInjector = self.INJECTED === 1 ? self.createStyleInjector : ({
const PATCH_ID = 'transition-patch'; const PATCH_ID = 'transition-patch';
// styles are out of order if any of these elements is injected between them // styles are out of order if any of these elements is injected between them
const ORDERED_TAGS = new Set(['head', 'body', 'frameset', 'style', 'link']); const ORDERED_TAGS = new Set(['head', 'body', 'frameset', 'style', 'link']);
const IS_OWN_PAGE = Boolean(chrome.tabs);
// detect Chrome 65 via a feature it added since browser version can be spoofed // detect Chrome 65 via a feature it added since browser version can be spoofed
const isChromePre65 = chrome.app && typeof Worklet !== 'function'; const isChromePre65 = chrome.app && typeof Worklet !== 'function';
const docRewriteObserver = RewriteObserver(_sort); const docRewriteObserver = RewriteObserver(_sort);
@ -159,7 +158,7 @@ self.createStyleInjector = self.INJECTED === 1 ? self.createStyleInjector : ({
} }
function _emitUpdate(value) { function _emitUpdate(value) {
_toggleObservers(!IS_OWN_PAGE && list.length); _toggleObservers(list.length);
onUpdate(); onUpdate();
return value; return value;
} }