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

Side by Side Diff: chrome/ext/popup.js

Issue 29371763: Issue 4795 - Use modern JavaScript syntax (Closed)
Patch Set: Created Jan. 13, 2017, 12:11 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
OLDNEW
1 (function()
2 { 1 {
3 var backgroundPage = chrome.extension.getBackgroundPage(); 2 let backgroundPage = chrome.extension.getBackgroundPage();
4 window.ext = Object.create(backgroundPage.ext); 3 window.ext = Object.create(backgroundPage.ext);
5 4
6 ext.closePopup = function() 5 ext.closePopup = () =>
7 { 6 {
8 window.close(); 7 window.close();
9 }; 8 };
10 9
11 // We have to override ext.backgroundPage, because in order 10 // We have to override ext.backgroundPage, because in order
12 // to send messages the local "chrome" namespace must be used. 11 // to send messages the local "chrome" namespace must be used.
13 ext.backgroundPage = { 12 ext.backgroundPage = {
14 sendMessage: chrome.runtime.sendMessage, 13 sendMessage: chrome.runtime.sendMessage,
15 14
16 getWindow: function() 15 getWindow: () => backgroundPage
17 {
18 return backgroundPage;
19 }
20 }; 16 };
21 })(); 17 }
OLDNEW
« chrome/ext/common.js ('K') | « chrome/ext/devtools.js ('k') | composer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld