OLD | NEW |
| (Empty) |
1 "use strict"; | |
2 | |
3 (function() | |
4 { | |
5 if (typeof chrome == "undefined" || typeof chrome.extension == "undefined") | |
6 window.chrome = browser; | |
7 const backgroundPage = chrome.extension.getBackgroundPage(); | |
8 window.ext = Object.create(backgroundPage.ext); | |
9 | |
10 // We have to override ext.backgroundPage, because in order | |
11 // to send messages the local "chrome" namespace must be used. | |
12 window.ext.backgroundPage = { | |
13 sendMessage: chrome.runtime.sendMessage, | |
14 | |
15 getWindow() | |
16 { | |
17 return backgroundPage; | |
18 } | |
19 }; | |
20 }()); | |
OLD | NEW |