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

Side by Side Diff: messageResponder.js

Issue 29522650: Issue 5316 - Adds dynamic filter types to devtools panel (Closed)
Patch Set: add css, fix selector, change message name, fix redundant port Created Sept. 1, 2017, 10:41 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 | « devtools-panel.js ('k') | skin/devtools-panel.css » ('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 <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present 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 24 matching lines...) Expand all
35 const {Filter, BlockingFilter, RegExpFilter} = require("filterClasses"); 35 const {Filter, BlockingFilter, RegExpFilter} = require("filterClasses");
36 const {Synchronizer} = require("synchronizer"); 36 const {Synchronizer} = require("synchronizer");
37 37
38 const info = require("info"); 38 const info = require("info");
39 const { 39 const {
40 Subscription, 40 Subscription,
41 DownloadableSubscription, 41 DownloadableSubscription,
42 SpecialSubscription 42 SpecialSubscription
43 } = require("subscriptionClasses"); 43 } = require("subscriptionClasses");
44 44
45 port.on("types.get", (message, sender) =>
46 Array.from(require("requestBlocker").filterTypes));
Sebastian Noack 2017/09/05 18:12:14 I wonder whether it would be worth to make sure th
Thomas Greiner 2017/09/06 11:00:25 Good point. We're currently not imposing any order
Jon Sonesen 2017/09/06 13:12:15 What about removing the OTHER return from lib/requ
Sebastian Noack 2017/09/06 17:39:19 I don't think the order matters much, except for O
Jon Sonesen 2017/09/07 07:46:17 Yeah, I agree here. Will do.
Thomas Greiner 2017/09/12 13:06:16 Good point. In that case no objections from my end
47
45 // Some modules doesn't exist on Firefox. Moreover, 48 // Some modules doesn't exist on Firefox. Moreover,
46 // require() throws an exception on Firefox in that case. 49 // require() throws an exception on Firefox in that case.
47 // However, try/catch causes the whole function to to be 50 // However, try/catch causes the whole function to to be
48 // deoptimized on V8. So we wrap it into another function. 51 // deoptimized on V8. So we wrap it into another function.
49 function tryRequire(module) 52 function tryRequire(module)
50 { 53 {
51 try 54 try
52 { 55 {
53 return require(module); 56 return require(module);
54 } 57 }
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 if (message.url) 437 if (message.url)
435 subscriptions = [Subscription.fromURL(message.url)]; 438 subscriptions = [Subscription.fromURL(message.url)];
436 439
437 for (let subscription of subscriptions) 440 for (let subscription of subscriptions)
438 { 441 {
439 if (subscription instanceof DownloadableSubscription) 442 if (subscription instanceof DownloadableSubscription)
440 Synchronizer.execute(subscription, true); 443 Synchronizer.execute(subscription, true);
441 } 444 }
442 }); 445 });
443 })(this); 446 })(this);
OLDNEW
« no previous file with comments | « devtools-panel.js ('k') | skin/devtools-panel.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld