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

Side by Side Diff: ext/popup.js

Issue 29569649: Issue 4580 - Replace ext.i18n with i18n (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Update adblockplusui dependency Created Oct. 10, 2017, 1 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/common.js ('k') | lib/filterComposer.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 if (typeof chrome == "undefined" || typeof chrome.extension == "undefined")
6 window.chrome = browser; 6 window.chrome = browser;
7 const backgroundPage = chrome.extension.getBackgroundPage(); 7 const backgroundPage = chrome.extension.getBackgroundPage();
8 window.ext = Object.create(backgroundPage.ext); 8 window.ext = Object.create(backgroundPage.ext);
9 9
10 // Calling i18n.getMessage from the background page causes Edge to throw an
11 // exception.
12 // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/127939 75/
13 window.ext.i18n = chrome.i18n;
14
15 // We have to override ext.backgroundPage, because in order 10 // We have to override ext.backgroundPage, because in order
16 // to send messages the local "chrome" namespace must be used. 11 // to send messages the local "chrome" namespace must be used.
17 window.ext.backgroundPage = { 12 window.ext.backgroundPage = {
18 sendMessage: chrome.runtime.sendMessage, 13 sendMessage: chrome.runtime.sendMessage,
19 14
20 getWindow() 15 getWindow()
21 { 16 {
22 return backgroundPage; 17 return backgroundPage;
23 } 18 }
24 }; 19 };
25 }()); 20 }());
OLDNEW
« no previous file with comments | « ext/common.js ('k') | lib/filterComposer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld