Index: chrome/ext/popup.js |
=================================================================== |
--- a/chrome/ext/popup.js |
+++ b/chrome/ext/popup.js |
@@ -1,6 +1,21 @@ |
-window.ext = Object.create(chrome.extension.getBackgroundPage().ext); |
+(function() |
+{ |
+ var backgroundPage = chrome.extension.getBackgroundPage(); |
+ window.ext = Object.create(backgroundPage.ext); |
-ext.closePopup = function() |
-{ |
- window.close(); |
-}; |
+ ext.closePopup = function() |
+ { |
+ window.close(); |
+ }; |
+ |
+ // We have to override ext.backgroundPage, because in order |
+ // to send messages the local "chrome" namespace must be used. |
+ ext.backgroundPage = { |
+ sendMessage: chrome.runtime.sendMessage, |
kzar
2015/03/02 19:00:32
Dumb idea: wrap the sendMessage call here to add a
Sebastian Noack
2015/03/02 19:42:08
Currently, we don't need that information. So addi
|
+ |
+ getWindow: function() |
+ { |
+ return backgroundPage; |
+ } |
+ }; |
+})(); |