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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 } | 76 } |
77 result[type] = filters; | 77 result[type] = filters; |
78 } | 78 } |
79 | 79 |
80 let elemHide = sandboxedRequire("../lib/elemHide"); | 80 let elemHide = sandboxedRequire("../lib/elemHide"); |
81 result.elemhide = []; | 81 result.elemhide = []; |
82 for (let key in elemHide.filterByKey) | 82 for (let key in elemHide.filterByKey) |
83 result.elemhide.push(elemHide.filterByKey[key].text); | 83 result.elemhide.push(elemHide.filterByKey[key].text); |
84 | 84 |
85 result.elemhideexception = []; | 85 result.elemhideexception = []; |
86 for (let selector in elemHide.exceptions) | 86 for (let [, list] of elemHide.exceptions) |
87 { | 87 { |
88 let list = elemHide.exceptions[selector]; | |
89 for (let exception of list) | 88 for (let exception of list) |
90 result.elemhideexception.push(exception.text); | 89 result.elemhideexception.push(exception.text); |
91 } | 90 } |
92 | 91 |
93 let elemHideEmulation = sandboxedRequire("../lib/elemHideEmulation"); | 92 let elemHideEmulation = sandboxedRequire("../lib/elemHideEmulation"); |
94 result.elemhideemulation = []; | 93 result.elemhideemulation = []; |
95 for (let filterText in elemHideEmulation.filters) | 94 for (let filterText of elemHideEmulation.filters) |
96 result.elemhideemulation.push(filterText); | 95 result.elemhideemulation.push(filterText); |
97 | 96 |
98 let types = ["blacklist", "whitelist", "elemhide", "elemhideexception", | 97 let types = ["blacklist", "whitelist", "elemhide", "elemhideexception", |
99 "elemhideemulation"]; | 98 "elemhideemulation"]; |
100 for (let type of types) | 99 for (let type of types) |
101 { | 100 { |
102 if (!(type in expected)) | 101 if (!(type in expected)) |
103 expected[type] = []; | 102 expected[type] = []; |
104 else | 103 else |
105 expected[type].sort(); | 104 expected[type].sort(); |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 checkKnownFilters(test, "disable exception rules", {blacklist: [filter1.text,
filter3.text], whitelist: [filter2.text]}); | 318 checkKnownFilters(test, "disable exception rules", {blacklist: [filter1.text,
filter3.text], whitelist: [filter2.text]}); |
320 | 319 |
321 FilterStorage.removeSubscription(subscription4); | 320 FilterStorage.removeSubscription(subscription4); |
322 checkKnownFilters(test, "remove subscription from the list", {blacklist: [filt
er1.text]}); | 321 checkKnownFilters(test, "remove subscription from the list", {blacklist: [filt
er1.text]}); |
323 | 322 |
324 subscription3.disabled = false; | 323 subscription3.disabled = false; |
325 checkKnownFilters(test, "enable exception rules", {blacklist: [filter1.text],
whitelist: [filter2.text]}); | 324 checkKnownFilters(test, "enable exception rules", {blacklist: [filter1.text],
whitelist: [filter2.text]}); |
326 | 325 |
327 test.done(); | 326 test.done(); |
328 }; | 327 }; |
OLD | NEW |