Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: ext/popup.js

Issue 29570614: Issue 5028 - Use browser namespace (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Fix indentation Created Oct. 9, 2017, 3:50 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ext/devtools.js ('k') | include.preload.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ext/popup.js
===================================================================
--- a/ext/popup.js
+++ b/ext/popup.js
@@ -1,20 +1,18 @@
"use strict";
(function()
{
- if (typeof chrome == "undefined" || typeof chrome.extension == "undefined")
- window.chrome = browser;
- const backgroundPage = chrome.extension.getBackgroundPage();
+ const backgroundPage = browser.extension.getBackgroundPage();
window.ext = Object.create(backgroundPage.ext);
// We have to override ext.backgroundPage, because in order
- // to send messages the local "chrome" namespace must be used.
+ // to send messages the local "browser" namespace must be used.
window.ext.backgroundPage = {
- sendMessage: chrome.runtime.sendMessage,
+ sendMessage: browser.runtime.sendMessage,
getWindow()
{
return backgroundPage;
}
};
}());
« no previous file with comments | « ext/devtools.js ('k') | include.preload.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld