insertCSS#cssOrigin requires FF53

This commit is contained in:
tophf 2017-09-30 02:32:43 +03:00
parent bf9ebab295
commit 9585aea08d

View File

@ -754,19 +754,18 @@ function handleCssTransitionBug({tabId, frameId, url, styles}) {
} }
function patchFirefox() { function patchFirefox() {
browser.tabs.insertCSS(tabId, { const options = {
frameId, frameId,
code: CSS_TRANSITION_SUPPRESSOR, code: CSS_TRANSITION_SUPPRESSOR,
cssOrigin: 'user', matchAboutBlank: true,
};
if (FIREFOX >= 53) {
options.cssOrigin = 'user';
}
browser.tabs.insertCSS(tabId, Object.assign(options, {
runAt: 'document_start', runAt: 'document_start',
matchAboutBlank: true, })).then(() => setTimeout(() => {
}).then(() => setTimeout(() => { browser.tabs.removeCSS(tabId, options).catch(ignoreChromeError);
browser.tabs.removeCSS(tabId, {
frameId,
code: CSS_TRANSITION_SUPPRESSOR,
cssOrigin: 'user',
matchAboutBlank: true,
}).catch(ignoreChromeError);
})).catch(ignoreChromeError); })).catch(ignoreChromeError);
} }