LEFT | RIGHT |
| 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 } |
LEFT | RIGHT |