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-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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 return; | 399 return; |
400 | 400 |
401 if (filter instanceof filterClasses.BlockingFilter) | 401 if (filter instanceof filterClasses.BlockingFilter) |
402 this.requestFilters.push(filter); | 402 this.requestFilters.push(filter); |
403 | 403 |
404 if (filter instanceof filterClasses.WhitelistFilter) | 404 if (filter instanceof filterClasses.WhitelistFilter) |
405 { | 405 { |
406 if (filter.contentType & (typeMap.DOCUMENT | whitelistableRequestTypes)) | 406 if (filter.contentType & (typeMap.DOCUMENT | whitelistableRequestTypes)) |
407 this.requestExceptions.push(filter); | 407 this.requestExceptions.push(filter); |
408 | 408 |
409 if (filter.contentType & typeMap.ELEMHIDE) | 409 if (filter.contentType & typeMap.ELEMHIDE) |
410 this.elemhideExceptions.push(filter); | 410 this.elemhideExceptions.push(filter); |
411 else if (filter.contentType & typeMap.GENERICHIDE) | 411 else if (filter.contentType & typeMap.GENERICHIDE) |
412 this.generichideExceptions.push(filter); | 412 this.generichideExceptions.push(filter); |
413 } | 413 } |
414 | 414 |
415 if (filter instanceof filterClasses.ElemHideFilter) | 415 if (filter instanceof filterClasses.ElemHideFilter) |
416 this.elemhideFilters.push(filter); | 416 this.elemhideFilters.push(filter); |
417 | 417 |
418 if (filter instanceof filterClasses.ElemHideException) | 418 if (filter instanceof filterClasses.ElemHideException) |
419 { | 419 { |
420 let domains = this.elemhideSelectorExceptions[filter.selector]; | 420 let domains = this.elemhideSelectorExceptions[filter.selector]; |
421 if (!domains) | 421 if (!domains) |
422 domains = this.elemhideSelectorExceptions[filter.selector] = []; | 422 domains = this.elemhideSelectorExceptions[filter.selector] = []; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 | 472 |
473 for (let filter of this.elemhideExceptions) | 473 for (let filter of this.elemhideExceptions) |
474 convertFilterAddRules(rules, filter, "ignore-previous-rules", false); | 474 convertFilterAddRules(rules, filter, "ignore-previous-rules", false); |
475 for (let filter of this.requestFilters) | 475 for (let filter of this.requestFilters) |
476 convertFilterAddRules(rules, filter, "block", true); | 476 convertFilterAddRules(rules, filter, "block", true); |
477 for (let filter of this.requestExceptions) | 477 for (let filter of this.requestExceptions) |
478 convertFilterAddRules(rules, filter, "ignore-previous-rules", true); | 478 convertFilterAddRules(rules, filter, "ignore-previous-rules", true); |
479 | 479 |
480 return rules.filter(rule => !hasNonASCI(rule)); | 480 return rules.filter(rule => !hasNonASCI(rule)); |
481 }; | 481 }; |
LEFT | RIGHT |