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

Delta Between Two Patch Sets: chrome/ext/popup.js

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

Powered by Google App Engine
This is Rietveld