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

Side by Side Diff: ext/popup.js

Issue 29458601: Issue 5315 - Add support for Microsoft Edge (Closed)
Patch Set: Use quoteCSS. Rephrase the comment. Created July 18, 2017, 10:28 a.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') | icons/abp-150.png » ('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")
6 window.chrome = browser;
5 const backgroundPage = chrome.extension.getBackgroundPage(); 7 const backgroundPage = chrome.extension.getBackgroundPage();
6 window.ext = Object.create(backgroundPage.ext); 8 window.ext = Object.create(backgroundPage.ext);
7 9
8 window.ext.closePopup = () => 10 window.ext.closePopup = () =>
9 { 11 {
10 window.close(); 12 window.close();
11 }; 13 };
12 14
15 // Calling getMessage with subsitutes on i18n from the background page causes
16 // Edge to throw an exception.
17 // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/127939 75/
18 window.ext.i18n = chrome.i18n;
19
13 // We have to override ext.backgroundPage, because in order 20 // We have to override ext.backgroundPage, because in order
14 // to send messages the local "chrome" namespace must be used. 21 // to send messages the local "chrome" namespace must be used.
15 window.ext.backgroundPage = { 22 window.ext.backgroundPage = {
16 sendMessage: chrome.runtime.sendMessage, 23 sendMessage: chrome.runtime.sendMessage,
17 24
18 getWindow() 25 getWindow()
19 { 26 {
20 return backgroundPage; 27 return backgroundPage;
21 } 28 }
22 }; 29 };
23 }()); 30 }());
OLDNEW
« no previous file with comments | « ext/common.js ('k') | icons/abp-150.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld