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

Side by Side Diff: ext/popup.js

Issue 29570614: Issue 5028 - Use browser namespace (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Use callback-based API for storage Created Oct. 9, 2017, 4:01 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ext/devtools.js ('k') | include.preload.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 "use strict"; 1 "use strict";
2 2
3 (function() 3 (function()
4 { 4 {
5 if (typeof chrome == "undefined" || typeof chrome.extension == "undefined") 5 const backgroundPage = browser.extension.getBackgroundPage();
6 window.chrome = browser;
7 const backgroundPage = chrome.extension.getBackgroundPage();
8 window.ext = Object.create(backgroundPage.ext); 6 window.ext = Object.create(backgroundPage.ext);
9 7
10 // We have to override ext.backgroundPage, because in order 8 // We have to override ext.backgroundPage, because in order
11 // to send messages the local "chrome" namespace must be used. 9 // to send messages the local "browser" namespace must be used.
12 window.ext.backgroundPage = { 10 window.ext.backgroundPage = {
13 sendMessage: chrome.runtime.sendMessage, 11 sendMessage: browser.runtime.sendMessage,
14 12
15 getWindow() 13 getWindow()
16 { 14 {
17 return backgroundPage; 15 return backgroundPage;
18 } 16 }
19 }; 17 };
20 }()); 18 }());
OLDNEW
« 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