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-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 |
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 /** | 18 /** |
19 * @fileOverview Element hiding implementation. | 19 * @fileOverview Element hiding implementation. |
20 */ | 20 */ |
21 | 21 |
22 Cu.import("resource://gre/modules/Services.jsm"); | 22 Cu.import("resource://gre/modules/Services.jsm"); |
23 | 23 |
24 let {Utils} = require("utils"); | 24 var {Utils} = require("utils"); |
25 let {IO} = require("io"); | 25 var {IO} = require("io"); |
26 let {Prefs} = require("prefs"); | 26 var {Prefs} = require("prefs"); |
27 let {ElemHideException} = require("filterClasses"); | 27 var {ElemHideException} = require("filterClasses"); |
28 let {FilterNotifier} = require("filterNotifier"); | 28 var {FilterNotifier} = require("filterNotifier"); |
29 | 29 |
30 /** | 30 /** |
31 * Lookup table, filters by their associated key | 31 * Lookup table, filters by their associated key |
32 * @type Object | 32 * @type Object |
33 */ | 33 */ |
34 let filterByKey = Object.create(null); | 34 var filterByKey = Object.create(null); |
35 | 35 |
36 /** | 36 /** |
37 * Lookup table, keys of the filters by filter text | 37 * Lookup table, keys of the filters by filter text |
38 * @type Object | 38 * @type Object |
39 */ | 39 */ |
40 let keyByFilter = Object.create(null); | 40 var keyByFilter = Object.create(null); |
41 | 41 |
42 /** | 42 /** |
43 * Lookup table, keys are known element hiding exceptions | 43 * Lookup table, keys are known element hiding exceptions |
44 * @type Object | 44 * @type Object |
45 */ | 45 */ |
46 let knownExceptions = Object.create(null); | 46 var knownExceptions = Object.create(null); |
47 | 47 |
48 /** | 48 /** |
49 * Lookup table, lists of element hiding exceptions by selector | 49 * Lookup table, lists of element hiding exceptions by selector |
50 * @type Object | 50 * @type Object |
51 */ | 51 */ |
52 let exceptions = Object.create(null); | 52 var exceptions = Object.create(null); |
53 | 53 |
54 /** | 54 /** |
55 * Currently applied stylesheet URL | 55 * Currently applied stylesheet URL |
56 * @type nsIURI | 56 * @type nsIURI |
57 */ | 57 */ |
58 let styleURL = null; | 58 var styleURL = null; |
59 | 59 |
60 /** | 60 /** |
61 * Element hiding component | 61 * Element hiding component |
62 * @class | 62 * @class |
63 */ | 63 */ |
64 let ElemHide = exports.ElemHide = | 64 var ElemHide = exports.ElemHide = |
65 { | 65 { |
66 /** | 66 /** |
67 * Indicates whether filters have been added or removed since the last apply()
call. | 67 * Indicates whether filters have been added or removed since the last apply()
call. |
68 * @type Boolean | 68 * @type Boolean |
69 */ | 69 */ |
70 isDirty: false, | 70 isDirty: false, |
71 | 71 |
72 /** | 72 /** |
73 * Inidicates whether the element hiding stylesheet is currently applied. | 73 * Inidicates whether the element hiding stylesheet is currently applied. |
74 * @type Boolean | 74 * @type Boolean |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 let filter = filterByKey[key]; | 380 let filter = filterByKey[key]; |
381 if (specificOnly && (!filter.domains || filter.domains[""])) | 381 if (specificOnly && (!filter.domains || filter.domains[""])) |
382 continue; | 382 continue; |
383 | 383 |
384 if (filter.isActiveOnDomain(domain) && !this.getException(filter, domain)) | 384 if (filter.isActiveOnDomain(domain) && !this.getException(filter, domain)) |
385 result.push(filter.selector); | 385 result.push(filter.selector); |
386 } | 386 } |
387 return result; | 387 return result; |
388 } | 388 } |
389 }; | 389 }; |
OLD | NEW |