skip unnecessary polyfills in content scripts

This commit is contained in:
tophf 2020-02-09 22:26:02 +03:00
parent 8842247cd0
commit cb4f875fe1

View File

@ -9,6 +9,11 @@ self.INJECTED !== 1 && (() => {
if (!Object.values) { if (!Object.values) {
Object.values = obj => Object.keys(obj).map(k => obj[k]); Object.values = obj => Object.keys(obj).map(k => obj[k]);
} }
// the above was shared by content scripts and workers,
// the rest is only needed for our extension pages
if (!self.chrome || !self.chrome.tabs) return;
if (typeof document === 'object') { if (typeof document === 'object') {
const ELEMENT_METH = { const ELEMENT_METH = {
append: { append: {