Left: | ||
Right: |
LEFT | RIGHT |
---|---|
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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
222 case "filters.get": | 222 case "filters.get": |
223 if (message.what == "elemhideemulation") | 223 if (message.what == "elemhideemulation") |
224 { | 224 { |
225 var filters = []; | 225 var filters = []; |
226 var checkWhitelisted = require("whitelisting").checkWhitelisted; | 226 var checkWhitelisted = require("whitelisting").checkWhitelisted; |
227 | 227 |
228 if (Prefs.enabled && !checkWhitelisted(sender.page, sender.frame, | 228 if (Prefs.enabled && !checkWhitelisted(sender.page, sender.frame, |
229 RegExpFilter.typeMap.DOCUMENT | | 229 RegExpFilter.typeMap.DOCUMENT | |
230 RegExpFilter.typeMap.ELEMHIDE)) | 230 RegExpFilter.typeMap.ELEMHIDE)) |
231 { | 231 { |
232 filters = ElemHideEmulation.getRulesForDomain(sender.frame.url.hostn ame); | 232 var hostname = sender.frame.url.hostname; |
kzar
2016/11/04 14:37:21
Nit: Mind fixing this long line?
Felix Dahlke
2016/11/04 17:38:46
Done.
| |
233 filters = ElemHideEmulation.getRulesForDomain(hostname); | |
233 filters = filters.map(function(filter) | 234 filters = filters.map(function(filter) |
234 { | 235 { |
235 return { | 236 return { |
236 features: filter.features, | |
237 selector: filter.selector, | 237 selector: filter.selector, |
238 text: filter.text | 238 text: filter.text |
239 }; | 239 }; |
240 }); | 240 }); |
241 } | 241 } |
242 callback(filters); | 242 callback(filters); |
243 break; | 243 break; |
244 } | 244 } |
245 | 245 |
246 var subscription = Subscription.fromURL(message.subscriptionUrl); | 246 var subscription = Subscription.fromURL(message.subscriptionUrl); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
402 for (var i = 0; i < subscriptions.length; i++) | 402 for (var i = 0; i < subscriptions.length; i++) |
403 { | 403 { |
404 var subscription = subscriptions[i]; | 404 var subscription = subscriptions[i]; |
405 if (subscription instanceof DownloadableSubscription) | 405 if (subscription instanceof DownloadableSubscription) |
406 Synchronizer.execute(subscription, true); | 406 Synchronizer.execute(subscription, true); |
407 } | 407 } |
408 break; | 408 break; |
409 } | 409 } |
410 }); | 410 }); |
411 })(this); | 411 })(this); |
LEFT | RIGHT |