From 5064ca1d4e92c01c2b6f6b50baf66a71caf593f1 Mon Sep 17 00:00:00 2001 From: tophf Date: Wed, 18 Oct 2017 21:30:17 +0300 Subject: [PATCH] prevent DOM id confusion DOM elements with an id are propagated as global variables https://stackoverflow.com/q/6381425 --- content/apply.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/content/apply.js b/content/apply.js index b28fd434..0b5601e4 100644 --- a/content/apply.js +++ b/content/apply.js @@ -1,5 +1,3 @@ -// Not using some slow features of ES6, see http://kpdecker.github.io/six-speed/ -// like destructring, classes, defaults, spread, calculated key names /* eslint no-var: 0 */ 'use strict'; @@ -40,7 +38,7 @@ function requestStyles(options, callback = applyStyles) { asHash: true, }, options); // On own pages we request the styles directly to minimize delay and flicker - if (typeof getStylesSafe !== 'undefined') { + if (typeof getStylesSafe === 'function') { getStylesSafe(request).then(callback); } else { chrome.runtime.sendMessage(request, callback);