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

Delta Between Two Patch Sets: ext/popup.js

Issue 29458601: Issue 5315 - Add support for Microsoft Edge (Closed)
Left Patch Set: Workaround CSS.excape, i18n issue and use typeof for 'undefined' detection Created July 17, 2017, 12:51 p.m.
Right Patch Set: Cosmetic changes Created July 28, 2017, 11:02 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « ext/common.js ('k') | icons/abp-150.png » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 window.ext.closePopup = () => 10 window.ext.closePopup = () =>
11 { 11 {
12 window.close(); 12 window.close();
13 }; 13 };
14 14
15 // Edge needs the i18n to be local, otherwise it can't process substitutions 15 // Calling i18n.getMessage from the background page causes Edge to throw an
kzar 2017/07/17 14:08:19 How about this? "Calling i18n from the background
Oleksandr 2017/07/17 23:52:09 Rephrased to be more precise. Calling i18n alone d
kzar 2017/07/18 09:30:49 "Calling i18n.getMessage from the background page
kzar 2017/07/18 10:36:23 It seems like your latest improvement to this comm
16 // exception.
16 // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/127939 75/ 17 // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/127939 75/
17 window.ext.i18n = chrome.i18n; 18 window.ext.i18n = chrome.i18n;
18 19
19 // We have to override ext.backgroundPage, because in order 20 // We have to override ext.backgroundPage, because in order
20 // to send messages the local "chrome" namespace must be used. 21 // to send messages the local "chrome" namespace must be used.
21 window.ext.backgroundPage = { 22 window.ext.backgroundPage = {
22 sendMessage: chrome.runtime.sendMessage, 23 sendMessage: chrome.runtime.sendMessage,
23 24
24 getWindow() 25 getWindow()
25 { 26 {
26 return backgroundPage; 27 return backgroundPage;
27 } 28 }
28 }; 29 };
29 }()); 30 }());
LEFTRIGHT

Powered by Google App Engine
This is Rietveld