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

Delta Between Two Patch Sets: messageResponder.js

Issue 29522650: Issue 5316 - Adds dynamic filter types to devtools panel (Closed)
Left Patch Set: move OTHER filterType to end of array Created Sept. 11, 2017, 10:36 a.m.
Right Patch Set: Created Sept. 12, 2017, 12:10 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « devtools-panel.js ('k') | skin/devtools-panel.css » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 27 matching lines...) Expand all
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) => 45 port.on("types.get", (message, sender) =>
46 { 46 {
47 let filterTypes = Array.from(require("requestBlocker").filterTypes); 47 let filterTypes = Array.from(require("requestBlocker").filterTypes);
48 filterTypes.push(filterTypes.splice(filterTypes.indexOf("OTHER"), 1)[0]); 48 filterTypes.push(...filterTypes.splice(filterTypes.indexOf("OTHER"), 1));
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; 49 return filterTypes;
50 }); 50 });
51 51
52 // Some modules doesn't exist on Firefox. Moreover, 52 // Some modules doesn't exist on Firefox. Moreover,
53 // require() throws an exception on Firefox in that case. 53 // require() throws an exception on Firefox in that case.
54 // However, try/catch causes the whole function to to be 54 // However, try/catch causes the whole function to to be
55 // deoptimized on V8. So we wrap it into another function. 55 // deoptimized on V8. So we wrap it into another function.
56 function tryRequire(module) 56 function tryRequire(module)
57 { 57 {
58 try 58 try
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 if (message.url) 441 if (message.url)
442 subscriptions = [Subscription.fromURL(message.url)]; 442 subscriptions = [Subscription.fromURL(message.url)];
443 443
444 for (let subscription of subscriptions) 444 for (let subscription of subscriptions)
445 { 445 {
446 if (subscription instanceof DownloadableSubscription) 446 if (subscription instanceof DownloadableSubscription)
447 Synchronizer.execute(subscription, true); 447 Synchronizer.execute(subscription, true);
448 } 448 }
449 }); 449 });
450 })(this); 450 })(this);
LEFTRIGHT

Powered by Google App Engine
This is Rietveld