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