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: Addressed some more feedback Created Jan. 18, 2017, 11:44 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 | « chrome/ext/devtools.js ('k') | composer.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 (function() 1 "use strict";
2
2 { 3 {
3 var backgroundPage = chrome.extension.getBackgroundPage(); 4 const backgroundPage = chrome.extension.getBackgroundPage();
4 window.ext = Object.create(backgroundPage.ext); 5 var ext = Object.create(backgroundPage.ext);
5 6
6 ext.closePopup = function() 7 ext.closePopup = () =>
7 { 8 {
8 window.close(); 9 window.close();
9 }; 10 };
10 11
11 // We have to override ext.backgroundPage, because in order 12 // We have to override ext.backgroundPage, because in order
12 // to send messages the local "chrome" namespace must be used. 13 // to send messages the local "chrome" namespace must be used.
13 ext.backgroundPage = { 14 ext.backgroundPage = {
14 sendMessage: chrome.runtime.sendMessage, 15 sendMessage: chrome.runtime.sendMessage,
15 16
16 getWindow: function() 17 getWindow()
17 { 18 {
18 return backgroundPage; 19 return backgroundPage;
19 } 20 }
20 }; 21 };
21 })(); 22 }
OLDNEW
« no previous file with comments | « chrome/ext/devtools.js ('k') | composer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld