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 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 { | 146 { |
147 this.text = text; | 147 this.text = text; |
148 this.disabled = false; | 148 this.disabled = false; |
149 } | 149 } |
150 }; | 150 }; |
151 modules.filterClasses.Filter.fromText = function(text) | 151 modules.filterClasses.Filter.fromText = function(text) |
152 { | 152 { |
153 return new modules.filterClasses.Filter(text); | 153 return new modules.filterClasses.Filter(text); |
154 }; | 154 }; |
155 | 155 |
| 156 modules.filterValidation = |
| 157 { |
| 158 FilterParsingError: function(type) |
| 159 { |
| 160 this.type = type; |
| 161 }, |
| 162 parseFilter: function(text) |
| 163 { |
| 164 if (text) |
| 165 { |
| 166 if (text[0] == "[") |
| 167 return {error: new modules.filterValidation.FilterParsingError("unexpe
cted-filter-list-header")}; |
| 168 } |
| 169 return {filter: modules.filterClasses.Filter.fromText(text)}; |
| 170 }, |
| 171 parseFilters: function(text) |
| 172 { |
| 173 var lines = text.split("\n"); |
| 174 var filters = []; |
| 175 var errors = []; |
| 176 |
| 177 for (var i = 0; i < lines.length; i++) |
| 178 { |
| 179 var parseResult = modules.filterValidation.parseFilter(lines[i]); |
| 180 if (parseResult.error) |
| 181 errors.push(parseResult.error); |
| 182 else |
| 183 filters.push(parseResult.filter); |
| 184 } |
| 185 |
| 186 return {filters: filters, errors: errors}; |
| 187 } |
| 188 }; |
| 189 modules.filterValidation.FilterParsingError.prototype.toString = function() |
| 190 { |
| 191 return this.type; |
| 192 }; |
| 193 |
156 modules.synchronizer = { | 194 modules.synchronizer = { |
157 Synchronizer: {} | 195 Synchronizer: {} |
158 }; | 196 }; |
159 | 197 |
160 modules.matcher = { | 198 modules.matcher = { |
161 defaultMatcher: { | 199 defaultMatcher: { |
162 matchesAny: function(url, requestType, docDomain, thirdParty) | 200 matchesAny: function(url, requestType, docDomain, thirdParty) |
163 { | 201 { |
164 var params = {blockedURLs: ""}; | 202 var params = {blockedURLs: ""}; |
165 updateFromURL(params); | 203 updateFromURL(params); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 { | 252 { |
215 return parseFloat(v1) - parseFloat(v2); | 253 return parseFloat(v1) - parseFloat(v2); |
216 } | 254 } |
217 } | 255 } |
218 }; | 256 }; |
219 | 257 |
220 var filters = [ | 258 var filters = [ |
221 "@@||alternate.de^$document", | 259 "@@||alternate.de^$document", |
222 "@@||der.postillion.com^$document", | 260 "@@||der.postillion.com^$document", |
223 "@@||taz.de^$document", | 261 "@@||taz.de^$document", |
224 "@@||amazon.de^$document" | 262 "@@||amazon.de^$document", |
| 263 "||biglemon.am/bg_poster/banner.jpg", |
| 264 "winfuture.de###header_logo_link", |
| 265 "###WerbungObenRechts10_GesamtDIV", |
| 266 "###WerbungObenRechts8_GesamtDIV", |
| 267 "###WerbungObenRechts9_GesamtDIV", |
| 268 "###WerbungUntenLinks4_GesamtDIV", |
| 269 "###WerbungUntenLinks7_GesamtDIV", |
| 270 "###WerbungUntenLinks8_GesamtDIV", |
| 271 "###WerbungUntenLinks9_GesamtDIV", |
| 272 "###Werbung_Sky", |
| 273 "###Werbung_Wide", |
| 274 "###__ligatus_placeholder__", |
| 275 "###ad-bereich1-08", |
| 276 "###ad-bereich1-superbanner", |
| 277 "###ad-bereich2-08", |
| 278 "###ad-bereich2-skyscrapper" |
225 ]; | 279 ]; |
226 var knownFilters = filters.map(modules.filterClasses.Filter.fromText); | 280 var knownFilters = filters.map(modules.filterClasses.Filter.fromText); |
227 | 281 |
228 var subscriptions = [ | 282 var subscriptions = [ |
229 "https://easylist-downloads.adblockplus.org/easylistgermany+easylist.txt", | 283 "https://easylist-downloads.adblockplus.org/easylistgermany+easylist.txt", |
230 "https://easylist-downloads.adblockplus.org/exceptionrules.txt", | 284 "https://easylist-downloads.adblockplus.org/exceptionrules.txt", |
231 "https://easylist-downloads.adblockplus.org/fanboy-social.txt", | 285 "https://easylist-downloads.adblockplus.org/fanboy-social.txt", |
232 "~user~786254" | 286 "~user~786254" |
233 ]; | 287 ]; |
234 var knownSubscriptions = Object.create(null); | 288 var knownSubscriptions = Object.create(null); |
(...skipping 18 matching lines...) Expand all Loading... |
253 type: "message", | 307 type: "message", |
254 payload: { | 308 payload: { |
255 title: "Custom subscription", | 309 title: "Custom subscription", |
256 url: "http://example.com/custom.txt", | 310 url: "http://example.com/custom.txt", |
257 type: "add-subscription" | 311 type: "add-subscription" |
258 } | 312 } |
259 }, "*"); | 313 }, "*"); |
260 }, 1000); | 314 }, 1000); |
261 } | 315 } |
262 })(this); | 316 })(this); |
OLD | NEW |