From cb4f875fe12f1e4b85544856a9c98d23d42535ed Mon Sep 17 00:00:00 2001 From: tophf Date: Sun, 9 Feb 2020 22:26:02 +0300 Subject: [PATCH] skip unnecessary polyfills in content scripts --- js/polyfill.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/polyfill.js b/js/polyfill.js index d79b14af..2b95b10d 100644 --- a/js/polyfill.js +++ b/js/polyfill.js @@ -9,6 +9,11 @@ self.INJECTED !== 1 && (() => { if (!Object.values) { 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') { const ELEMENT_METH = { append: {