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: move OTHER filterType to end of array Created Sept. 11, 2017, 10:36 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 {
47 let filterTypes = Array.from(require("requestBlocker").filterTypes);
48 filterTypes.push(filterTypes.splice(filterTypes.indexOf("OTHER"), 1)[0]);
Sebastian Noack 2017/09/11 16:44:14 I would rather use the rest operator here. That wa
Jon Sonesen 2017/09/12 11:42:41 Oh, nifty. Thanks for pointing that out
49 return filterTypes;
50 });
51
45 // Some modules doesn't exist on Firefox. Moreover, 52 // Some modules doesn't exist on Firefox. Moreover,
46 // require() throws an exception on Firefox in that case. 53 // require() throws an exception on Firefox in that case.
47 // However, try/catch causes the whole function to to be 54 // However, try/catch causes the whole function to to be
48 // deoptimized on V8. So we wrap it into another function. 55 // deoptimized on V8. So we wrap it into another function.
49 function tryRequire(module) 56 function tryRequire(module)
50 { 57 {
51 try 58 try
52 { 59 {
53 return require(module); 60 return require(module);
54 } 61 }
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 if (message.url) 441 if (message.url)
435 subscriptions = [Subscription.fromURL(message.url)]; 442 subscriptions = [Subscription.fromURL(message.url)];
436 443
437 for (let subscription of subscriptions) 444 for (let subscription of subscriptions)
438 { 445 {
439 if (subscription instanceof DownloadableSubscription) 446 if (subscription instanceof DownloadableSubscription)
440 Synchronizer.execute(subscription, true); 447 Synchronizer.execute(subscription, true);
441 } 448 }
442 }); 449 });
443 })(this); 450 })(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