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 |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
16 */ | 16 */ |
17 | 17 |
18 "use strict"; | 18 "use strict"; |
19 | 19 |
20 /** | 20 /** |
21 * @fileOverview Definition of Filter class and its subclasses. | 21 * @fileOverview Definition of Filter class and its subclasses. |
22 */ | 22 */ |
23 | 23 |
24 const {FilterNotifier} = require("./filterNotifier"); | 24 const {filterNotifier} = require("./filterNotifier"); |
25 const {extend} = require("./coreUtils"); | 25 const {extend} = require("./coreUtils"); |
26 const {filterToRegExp} = require("./common"); | 26 const {filterToRegExp} = require("./common"); |
27 | 27 |
28 /** | 28 /** |
29 * All known unique domain sources mapped to their parsed values. | 29 * All known unique domain sources mapped to their parsed values. |
30 * @type {Map.<string,Map.<string,boolean>>} | 30 * @type {Map.<string,Map.<string,boolean>>} |
31 */ | 31 */ |
32 let knownDomainMaps = new Map(); | 32 let knownDomainMaps = new Map(); |
33 | 33 |
34 /** | 34 /** |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 get disabled() | 312 get disabled() |
313 { | 313 { |
314 return this._disabled; | 314 return this._disabled; |
315 }, | 315 }, |
316 set disabled(value) | 316 set disabled(value) |
317 { | 317 { |
318 if (value != this._disabled) | 318 if (value != this._disabled) |
319 { | 319 { |
320 let oldValue = this._disabled; | 320 let oldValue = this._disabled; |
321 this._disabled = value; | 321 this._disabled = value; |
322 FilterNotifier.emit("filter.disabled", this, value, oldValue); | 322 filterNotifier.emit("filter.disabled", this, value, oldValue); |
323 } | 323 } |
324 return this._disabled; | 324 return this._disabled; |
325 }, | 325 }, |
326 | 326 |
327 /** | 327 /** |
328 * Number of hits on the filter since the last reset | 328 * Number of hits on the filter since the last reset |
329 * @type {number} | 329 * @type {number} |
330 */ | 330 */ |
331 get hitCount() | 331 get hitCount() |
332 { | 332 { |
333 return this._hitCount; | 333 return this._hitCount; |
334 }, | 334 }, |
335 set hitCount(value) | 335 set hitCount(value) |
336 { | 336 { |
337 if (value != this._hitCount) | 337 if (value != this._hitCount) |
338 { | 338 { |
339 let oldValue = this._hitCount; | 339 let oldValue = this._hitCount; |
340 this._hitCount = value; | 340 this._hitCount = value; |
341 FilterNotifier.emit("filter.hitCount", this, value, oldValue); | 341 filterNotifier.emit("filter.hitCount", this, value, oldValue); |
342 } | 342 } |
343 return this._hitCount; | 343 return this._hitCount; |
344 }, | 344 }, |
345 | 345 |
346 /** | 346 /** |
347 * Last time the filter had a hit (in milliseconds since the beginning of the | 347 * Last time the filter had a hit (in milliseconds since the beginning of the |
348 * epoch) | 348 * epoch) |
349 * @type {number} | 349 * @type {number} |
350 */ | 350 */ |
351 get lastHit() | 351 get lastHit() |
352 { | 352 { |
353 return this._lastHit; | 353 return this._lastHit; |
354 }, | 354 }, |
355 set lastHit(value) | 355 set lastHit(value) |
356 { | 356 { |
357 if (value != this._lastHit) | 357 if (value != this._lastHit) |
358 { | 358 { |
359 let oldValue = this._lastHit; | 359 let oldValue = this._lastHit; |
360 this._lastHit = value; | 360 this._lastHit = value; |
361 FilterNotifier.emit("filter.lastHit", this, value, oldValue); | 361 filterNotifier.emit("filter.lastHit", this, value, oldValue); |
362 } | 362 } |
363 return this._lastHit; | 363 return this._lastHit; |
364 }, | 364 }, |
365 | 365 |
366 /** | 366 /** |
367 * String that the domains property should be generated from | 367 * String that the domains property should be generated from |
368 * @type {?string} | 368 * @type {?string} |
369 */ | 369 */ |
370 domainSource: null, | 370 domainSource: null, |
371 | 371 |
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1177 | 1177 |
1178 /** | 1178 /** |
1179 * Script that should be executed | 1179 * Script that should be executed |
1180 * @type {string} | 1180 * @type {string} |
1181 */ | 1181 */ |
1182 get script() | 1182 get script() |
1183 { | 1183 { |
1184 return this.body; | 1184 return this.body; |
1185 } | 1185 } |
1186 }); | 1186 }); |
OLD | NEW |