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-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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 * @param {SnippetFilter} filter | 56 * @param {SnippetFilter} filter |
57 */ | 57 */ |
58 remove(filter) | 58 remove(filter) |
59 { | 59 { |
60 filters.delete(filter.text); | 60 filters.delete(filter.text); |
61 }, | 61 }, |
62 | 62 |
63 /** | 63 /** |
64 * Returns a list of all snippet filters active on a particular domain | 64 * Returns a list of all snippet filters active on a particular domain |
65 * @param {string} domain | 65 * @param {string} domain |
66 * @return {Filter[]} | 66 * @return {Array.<SnippetFilter>} |
67 */ | 67 */ |
68 getSnippetsForDomain(domain) | 68 getFiltersForDomain(domain) |
69 { | 69 { |
70 let result = []; | 70 let result = []; |
71 for (let text of filters) | 71 for (let text of filters) |
72 { | 72 { |
73 let filter = Filter.fromText(text); | 73 let filter = Filter.fromText(text); |
74 if (filter.isActiveOnDomain(domain)) | 74 if (filter.isActiveOnDomain(domain)) |
75 result.push(filter); | 75 result.push(filter); |
76 } | 76 } |
77 return result; | 77 return result; |
78 } | 78 } |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 let value = imports[name]; | 188 let value = imports[name]; |
189 if (typeof value == "function") | 189 if (typeof value == "function") |
190 value(...args); | 190 value(...args); |
191 } | 191 } |
192 } | 192 } |
193 } | 193 } |
194 `; | 194 `; |
195 } | 195 } |
196 | 196 |
197 exports.compileScript = compileScript; | 197 exports.compileScript = compileScript; |
LEFT | RIGHT |