| 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-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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 } | 454 } |
| 455 | 455 |
| 456 if (!domains) | 456 if (!domains) |
| 457 domains = new Map(); | 457 domains = new Map(); |
| 458 | 458 |
| 459 domains.set(domain, include); | 459 domains.set(domain, include); |
| 460 } | 460 } |
| 461 if (domains) | 461 if (domains) |
| 462 domains.set("", !hasIncludes); | 462 domains.set("", !hasIncludes); |
| 463 } | 463 } |
| 464 | |
| 465 this.domainSource = null; | |
| 466 } | 464 } |
| 467 | 465 |
| 468 Object.defineProperty(this, "domains", {value: domains, enumerable: true}); | 466 Object.defineProperty(this, "domains", {value: domains, enumerable: true}); |
| 467 delete this.domainSource; |
| 469 return this.domains; | 468 return this.domains; |
| 470 }, | 469 }, |
| 471 | 470 |
| 472 /** | 471 /** |
| 473 * Array containing public keys of websites that this filter should apply to | 472 * Array containing public keys of websites that this filter should apply to |
| 474 * @type {?string[]} | 473 * @type {?string[]} |
| 475 */ | 474 */ |
| 476 sitekeys: null, | 475 sitekeys: null, |
| 477 | 476 |
| 478 /** | 477 /** |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 { | 703 { |
| 705 // Despite this property being cached, the getter is called | 704 // Despite this property being cached, the getter is called |
| 706 // several times on Safari, due to WebKit bug 132872 | 705 // several times on Safari, due to WebKit bug 132872 |
| 707 let prop = Object.getOwnPropertyDescriptor(this, "sitekeys"); | 706 let prop = Object.getOwnPropertyDescriptor(this, "sitekeys"); |
| 708 if (prop) | 707 if (prop) |
| 709 return prop.value; | 708 return prop.value; |
| 710 | 709 |
| 711 let sitekeys = null; | 710 let sitekeys = null; |
| 712 | 711 |
| 713 if (this.sitekeySource) | 712 if (this.sitekeySource) |
| 714 { | |
| 715 sitekeys = this.sitekeySource.split("|"); | 713 sitekeys = this.sitekeySource.split("|"); |
| 716 this.sitekeySource = null; | |
| 717 } | |
| 718 | 714 |
| 719 Object.defineProperty( | 715 Object.defineProperty( |
| 720 this, "sitekeys", {value: sitekeys, enumerable: true} | 716 this, "sitekeys", {value: sitekeys, enumerable: true} |
| 721 ); | 717 ); |
| 718 delete this.sitekeySource; |
| 722 return this.sitekeys; | 719 return this.sitekeys; |
| 723 }, | 720 }, |
| 724 | 721 |
| 725 /** | 722 /** |
| 726 * Tests whether the URL matches this filter | 723 * Tests whether the URL matches this filter |
| 727 * @param {string} location URL to be tested | 724 * @param {string} location URL to be tested |
| 728 * @param {number} typeMask bitmask of content / request types to match | 725 * @param {number} typeMask bitmask of content / request types to match |
| 729 * @param {string} [docDomain] domain name of the document that loads the URL | 726 * @param {string} [docDomain] domain name of the document that loads the URL |
| 730 * @param {boolean} [thirdParty] should be true if the URL is a third-party | 727 * @param {boolean} [thirdParty] should be true if the URL is a third-party |
| 731 * request | 728 * request |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1114 */ | 1111 */ |
| 1115 function ElemHideEmulationFilter(text, domains, selector) | 1112 function ElemHideEmulationFilter(text, domains, selector) |
| 1116 { | 1113 { |
| 1117 ElemHideBase.call(this, text, domains, selector); | 1114 ElemHideBase.call(this, text, domains, selector); |
| 1118 } | 1115 } |
| 1119 exports.ElemHideEmulationFilter = ElemHideEmulationFilter; | 1116 exports.ElemHideEmulationFilter = ElemHideEmulationFilter; |
| 1120 | 1117 |
| 1121 ElemHideEmulationFilter.prototype = extend(ElemHideBase, { | 1118 ElemHideEmulationFilter.prototype = extend(ElemHideBase, { |
| 1122 type: "elemhideemulation" | 1119 type: "elemhideemulation" |
| 1123 }); | 1120 }); |
| OLD | NEW |