Left: | ||
Right: |
OLD | NEW |
---|---|
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-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
190 }); | 190 }); |
191 | 191 |
192 port.on("app.listen", (message, sender) => | 192 port.on("app.listen", (message, sender) => |
193 { | 193 { |
194 getListenerFilters(sender.page).app = message.filter; | 194 getListenerFilters(sender.page).app = message.filter; |
195 }); | 195 }); |
196 | 196 |
197 port.on("app.open", (message, sender) => | 197 port.on("app.open", (message, sender) => |
198 { | 198 { |
199 if (message.what == "options") | 199 if (message.what == "options") |
200 ext.showOptions(); | 200 { |
saroyanm
2017/07/18 12:46:26
Why is this change necessary ?
Thomas Greiner
2017/07/18 17:42:30
This is how we pass the domain to the options page
| |
201 ext.showOptions(() => | |
202 { | |
203 if (!message.action) | |
204 return; | |
205 | |
206 sendMessage("app", message.action, ...message.args); | |
207 }); | |
208 } | |
201 }); | 209 }); |
202 | 210 |
203 port.on("filters.add", (message, sender) => | 211 port.on("filters.add", (message, sender) => |
204 { | 212 { |
205 let result = require("filterValidation").parseFilter(message.text); | 213 let result = require("filterValidation").parseFilter(message.text); |
206 let errors = []; | 214 let errors = []; |
207 if (result.error) | 215 if (result.error) |
208 errors.push(result.error.toString()); | 216 errors.push(result.error.toString()); |
209 else if (result.filter) | 217 else if (result.filter) |
210 FilterStorage.addFilter(result.filter); | 218 FilterStorage.addFilter(result.filter); |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
424 if (message.url) | 432 if (message.url) |
425 subscriptions = [Subscription.fromURL(message.url)]; | 433 subscriptions = [Subscription.fromURL(message.url)]; |
426 | 434 |
427 for (let subscription of subscriptions) | 435 for (let subscription of subscriptions) |
428 { | 436 { |
429 if (subscription instanceof DownloadableSubscription) | 437 if (subscription instanceof DownloadableSubscription) |
430 Synchronizer.execute(subscription, true); | 438 Synchronizer.execute(subscription, true); |
431 } | 439 } |
432 }); | 440 }); |
433 })(this); | 441 })(this); |
OLD | NEW |