Left: | ||
Right: |
OLD | NEW |
---|---|
1 (function() | 1 "use strict"; |
2 | |
2 { | 3 { |
3 var backgroundPage = chrome.extension.getBackgroundPage(); | 4 let backgroundPage = chrome.extension.getBackgroundPage(); |
4 window.ext = Object.create(backgroundPage.ext); | 5 window.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() { return backgroundPage; } |
Sebastian Noack
2017/01/16 15:35:55
As pointed out in a different file, in the previou
kzar
2017/01/17 07:42:48
Whoops, another victim from switching to an inline
| |
17 { | |
18 return backgroundPage; | |
19 } | |
20 }; | 18 }; |
21 })(); | 19 } |
OLD | NEW |