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: Addressed comment Created March 2, 2015, 7:42 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/ext/background.js ('k') | safari/ext/background.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
15
16 getWindow: function()
17 {
18 return backgroundPage;
19 }
20 };
21 })();
OLDNEW
« no previous file with comments | « chrome/ext/background.js ('k') | safari/ext/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld