Left: | ||
Right: |
OLD | NEW |
---|---|
1 "use strict"; | 1 "use strict"; |
2 | 2 |
3 { | 3 { |
4 const backgroundPage = chrome.extension.getBackgroundPage(); | 4 const backgroundPage = chrome.extension.getBackgroundPage(); |
5 | |
6 /* eslint-disable no-var */ | |
5 var ext = Object.create(backgroundPage.ext); | 7 var ext = Object.create(backgroundPage.ext); |
Sebastian Noack
2017/02/09 01:04:49
The popup code (also) broke because you used Objec
kzar
2017/02/20 10:27:30
Ah well spotted, Done.
| |
8 /* eslint-enable no-var */ | |
6 | 9 |
7 ext.closePopup = () => | 10 ext.closePopup = () => |
8 { | 11 { |
9 window.close(); | 12 window.close(); |
10 }; | 13 }; |
11 | 14 |
12 // We have to override ext.backgroundPage, because in order | 15 // We have to override ext.backgroundPage, because in order |
13 // to send messages the local "chrome" namespace must be used. | 16 // to send messages the local "chrome" namespace must be used. |
14 ext.backgroundPage = { | 17 ext.backgroundPage = { |
15 sendMessage: chrome.runtime.sendMessage, | 18 sendMessage: chrome.runtime.sendMessage, |
16 | 19 |
17 getWindow() | 20 getWindow() |
18 { | 21 { |
19 return backgroundPage; | 22 return backgroundPage; |
20 } | 23 } |
21 }; | 24 }; |
22 } | 25 } |
OLD | NEW |