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

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

Issue 5162273421131776: Issue 1768 - Pass value returned by ext.onMessage listeners to chrome.runtime.onMessage listener (Closed)
Patch Set: Created Jan. 9, 2015, 10:56 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 | chrome/ext/content.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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 /* Web requests */ 247 /* Web requests */
248 248
249 var framesOfTabs = {__proto__: null}; 249 var framesOfTabs = {__proto__: null};
250 250
251 ext.getFrame = function(tabId, frameId) 251 ext.getFrame = function(tabId, frameId)
252 { 252 {
253 return (framesOfTabs[tabId] || {})[frameId]; 253 return (framesOfTabs[tabId] || {})[frameId];
254 }; 254 };
255 255
256 ext.webRequest = { 256 ext.webRequest = {
257 onBeforeRequest: new ext._EventTarget(true), 257 onBeforeRequest: new ext._EventTarget(),
Sebastian Noack 2015/01/09 10:58:25 Beside passing the return value below, I also forg
258 handlerBehaviorChanged: chrome.webRequest.handlerBehaviorChanged 258 handlerBehaviorChanged: chrome.webRequest.handlerBehaviorChanged
259 }; 259 };
260 260
261 chrome.tabs.query({}, function(tabs) 261 chrome.tabs.query({}, function(tabs)
262 { 262 {
263 tabs.forEach(function(tab) 263 tabs.forEach(function(tab)
264 { 264 {
265 chrome.webNavigation.getAllFrames({tabId: tab.id}, function(details) 265 chrome.webNavigation.getAllFrames({tabId: tab.id}, function(details)
266 { 266 {
267 if (details && details.length > 0) 267 if (details && details.length > 0)
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 if (frames[frameId].url == rawSender.url) 385 if (frames[frameId].url == rawSender.url)
386 return frames[frameId].parent; 386 return frames[frameId].parent;
387 } 387 }
388 } 388 }
389 389
390 return frames[0]; 390 return frames[0];
391 } 391 }
392 } 392 }
393 }; 393 };
394 394
395 return ext.onMessage._dispatch(message, sender, sendResponse); 395 return ext.onMessage._dispatch(message, sender, sendResponse).indexOf(true) != -1;
396 }); 396 });
397 397
398 398
399 /* Storage */ 399 /* Storage */
400 400
401 ext.storage = localStorage; 401 ext.storage = localStorage;
402 402
403 403
404 /* Options */ 404 /* Options */
405 405
(...skipping 23 matching lines...) Expand all
429 callback(new Page(tab)); 429 callback(new Page(tab));
430 } 430 }
431 else 431 else
432 { 432 {
433 ext.pages.open(optionsUrl, callback); 433 ext.pages.open(optionsUrl, callback);
434 } 434 }
435 }); 435 });
436 }); 436 });
437 }; 437 };
438 })(); 438 })();
OLDNEW
« no previous file with comments | « no previous file | chrome/ext/content.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld