Index: polyfill.js |
=================================================================== |
--- a/polyfill.js |
+++ b/polyfill.js |
@@ -12,16 +12,18 @@ |
* GNU General Public License for more details. |
* |
* You should have received a copy of the GNU General Public License |
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
*/ |
"use strict"; |
+var browser; |
+ |
{ |
const asyncAPIs = [ |
"contextMenus.removeAll", |
"devtools.panels.create", |
"notifications.clear", |
"notifications.create", |
"runtime.openOptionsPage", |
"runtime.sendMessage", |
@@ -127,17 +129,17 @@ |
} |
if (shouldWrapAPIs()) |
{ |
// Unlike Firefox and Microsoft Edge, Chrome doesn't have a "browser" object, |
// but provides the extension API through the "chrome" namespace |
// (non-standard). |
if (typeof browser == "undefined") |
- window.browser = chrome; |
+ browser = chrome; |
for (let api of asyncAPIs) |
wrapAPI(api); |
} |
// Workaround since HTMLCollection, NodeList, StyleSheetList, and CSSRuleList |
// didn't have iterator support before Chrome 51. |
// https://bugs.chromium.org/p/chromium/issues/detail?id=401699 |