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-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 | 472 |
473 for (let domain in this.domains) | 473 for (let domain in this.domains) |
474 if (this.domains[domain] && domain != docDomain && (domain.length <= docDo
main.length || domain.indexOf("." + docDomain) != domain.length - docDomain.leng
th - 1)) | 474 if (this.domains[domain] && domain != docDomain && (domain.length <= docDo
main.length || domain.indexOf("." + docDomain) != domain.length - docDomain.leng
th - 1)) |
475 return false; | 475 return false; |
476 | 476 |
477 return true; | 477 return true; |
478 }, | 478 }, |
479 | 479 |
480 /** | 480 /** |
481 * Checks whether this filter is generic or specific | 481 * Checks whether this filter is generic or specific |
482 * @return {Boolean} true if filter is generic, otherwise false | |
483 */ | 482 */ |
484 isGeneric: function() /**Boolean*/ | 483 isGeneric: function() /**Boolean*/ |
485 { | 484 { |
486 return (!(this.sitekeys && this.sitekeys.length) && | 485 return !(this.sitekeys && this.sitekeys.length) && |
487 (!this.domains || this.domains[""])); | 486 (!this.domains || this.domains[""]); |
488 }, | 487 }, |
489 | 488 |
490 /** | 489 /** |
491 * See Filter.serialize() | 490 * See Filter.serialize() |
492 */ | 491 */ |
493 serialize: function(buffer) | 492 serialize: function(buffer) |
494 { | 493 { |
495 if (this._disabled || this._hitCount || this._lastHit) | 494 if (this._disabled || this._hitCount || this._lastHit) |
496 { | 495 { |
497 Filter.prototype.serialize.call(this, buffer); | 496 Filter.prototype.serialize.call(this, buffer); |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1038 // several times on Safari, due to WebKit bug 132872 | 1037 // several times on Safari, due to WebKit bug 132872 |
1039 let prop = Object.getOwnPropertyDescriptor(this, "regexpString"); | 1038 let prop = Object.getOwnPropertyDescriptor(this, "regexpString"); |
1040 if (prop) | 1039 if (prop) |
1041 return prop.value; | 1040 return prop.value; |
1042 | 1041 |
1043 let regexp = Filter.toRegExp(this.regexpSource); | 1042 let regexp = Filter.toRegExp(this.regexpSource); |
1044 Object.defineProperty(this, "regexpString", {value: regexp}); | 1043 Object.defineProperty(this, "regexpString", {value: regexp}); |
1045 return regexp; | 1044 return regexp; |
1046 } | 1045 } |
1047 }; | 1046 }; |
LEFT | RIGHT |