remove the obsolete Chrome pre-65 workaround
This commit is contained in:
parent
cacb3177d5
commit
5ba48bbdb7
|
@ -8,8 +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']);
|
||||||
// detect Chrome 65 via a feature it added since browser version can be spoofed
|
|
||||||
const isChromePre65 = chrome.app && typeof Worklet !== 'function';
|
|
||||||
const docRewriteObserver = RewriteObserver(_sort);
|
const docRewriteObserver = RewriteObserver(_sort);
|
||||||
const docRootObserver = RootObserver(_sortIfNeeded);
|
const docRootObserver = RootObserver(_sortIfNeeded);
|
||||||
const list = [];
|
const list = [];
|
||||||
|
@ -232,17 +230,8 @@ self.createStyleInjector = self.INJECTED === 1 ? self.createStyleInjector : ({
|
||||||
|
|
||||||
function _update({id, code}) {
|
function _update({id, code}) {
|
||||||
const style = table.get(id);
|
const style = table.get(id);
|
||||||
if (style.code === code) return;
|
if (style.code !== code) {
|
||||||
style.code = code;
|
style.code = code;
|
||||||
// workaround for Chrome devtools bug fixed in v65
|
|
||||||
if (isChromePre65) {
|
|
||||||
const oldEl = style.el;
|
|
||||||
style.el = _createStyle(id, code);
|
|
||||||
if (isEnabled) {
|
|
||||||
oldEl.parentNode.insertBefore(style.el, oldEl.nextSibling);
|
|
||||||
oldEl.remove();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
style.el.textContent = code;
|
style.el.textContent = code;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user