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

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

Issue 6327452271902720: Pass return value of ext.onMessage listener through to chrome.runtime.onMessage (Closed)
Patch Set: Created April 14, 2014, 9:12 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
« no previous file with comments | « no previous file | ext/common.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 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 21 matching lines...) Expand all
32 var onMessage; 32 var onMessage;
33 if ("runtime" in chrome && "onMessage" in chrome.runtime) 33 if ("runtime" in chrome && "onMessage" in chrome.runtime)
34 onMessage = chrome.runtime.onMessage; 34 onMessage = chrome.runtime.onMessage;
35 else if ("onMessage" in chrome.extension) 35 else if ("onMessage" in chrome.extension)
36 onMessage = chrome.extension.onMessage; 36 onMessage = chrome.extension.onMessage;
37 else 37 else
38 onMessage = chrome.extension.onRequest; 38 onMessage = chrome.extension.onRequest;
39 39
40 onMessage.addListener(function(message, sender, sendResponse) 40 onMessage.addListener(function(message, sender, sendResponse)
41 { 41 {
42 ext.onMessage._dispatch(message, wrapSender(sender), sendResponse); 42 return ext.onMessage._dispatch(message, wrapSender(sender), sendResponse);
43 }); 43 });
44 }; 44 };
45 45
46 ext.onMessage = new ext._EventTarget(); 46 ext.onMessage = new ext._EventTarget();
47 47
48 48
49 /* Background page */ 49 /* Background page */
50 50
51 ext.backgroundPage = { 51 ext.backgroundPage = {
52 sendMessage: sendMessage, 52 sendMessage: sendMessage,
53 getWindow: function() 53 getWindow: function()
54 { 54 {
55 return chrome.extension.getBackgroundPage(); 55 return chrome.extension.getBackgroundPage();
56 } 56 }
57 }; 57 };
58 58
59 59
60 /* Utils */ 60 /* Utils */
61 61
62 ext.getURL = chrome.extension.getURL; 62 ext.getURL = chrome.extension.getURL;
63 ext.i18n = chrome.i18n; 63 ext.i18n = chrome.i18n;
64 })(); 64 })();
OLDNEW
« no previous file with comments | « no previous file | ext/common.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld