Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: chrome/ext/popup.js

Issue 5703008528629760: Issue 2071 - Fixed issues when sending messages from the popup to the background page (Closed)
Patch Set: Created March 2, 2015, 11:57 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
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,
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
15
16 getWindow: function()
17 {
18 return backgroundPage;
19 }
20 };
21 })();
OLDNEW

Powered by Google App Engine
This is Rietveld