OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
3 * Copyright (C) 2006-2014 Eyeo GmbH | 3 * Copyright (C) 2006-2014 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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 Cu.reportError(e); | 372 Cu.reportError(e); |
373 } | 373 } |
374 ElemHide.applied = false; | 374 ElemHide.applied = false; |
375 } | 375 } |
376 }, | 376 }, |
377 | 377 |
378 /** | 378 /** |
379 * Retrieves the currently applied stylesheet URL | 379 * Retrieves the currently applied stylesheet URL |
380 * @type String | 380 * @type String |
381 */ | 381 */ |
382 get styleURL() ElemHide.applied ? styleURL.spec : null, | 382 get styleURL() { |
| 383 return ElemHide.applied ? styleURL.spec : null; |
| 384 }, |
383 | 385 |
384 /** | 386 /** |
385 * Retrieves an element hiding filter by the corresponding protocol key | 387 * Retrieves an element hiding filter by the corresponding protocol key |
386 */ | 388 */ |
387 getFilterByKey: function(/**String*/ key) /**Filter*/ | 389 getFilterByKey: function(/**String*/ key) /**Filter*/ |
388 { | 390 { |
389 return (key in filterByKey ? filterByKey[key] : null); | 391 return (key in filterByKey ? filterByKey[key] : null); |
390 }, | 392 }, |
391 | 393 |
392 /** | 394 /** |
393 * Returns a list of all selectors active on a particular domain (currently | 395 * Returns a list of all selectors active on a particular domain (currently |
394 * used only in Chrome). | 396 * used only in Chrome). |
395 */ | 397 */ |
396 getSelectorsForDomain: function(/**String*/ domain, /**Boolean*/ specificOnly) | 398 getSelectorsForDomain: function(/**String*/ domain, /**Boolean*/ specificOnly) |
397 { | 399 { |
398 let result = []; | 400 let result = []; |
399 for (let key in filterByKey) | 401 for (let key in filterByKey) |
400 { | 402 { |
401 let filter = filterByKey[key]; | 403 let filter = filterByKey[key]; |
402 if (specificOnly && (!filter.domains || filter.domains[""])) | 404 if (specificOnly && (!filter.domains || filter.domains[""])) |
403 continue; | 405 continue; |
404 | 406 |
405 if (filter.isActiveOnDomain(domain) && !this.getException(filter, domain)) | 407 if (filter.isActiveOnDomain(domain) && !this.getException(filter, domain)) |
406 result.push(filter.selector); | 408 result.push(filter.selector); |
407 } | 409 } |
408 return result; | 410 return result; |
409 } | 411 } |
410 }; | 412 }; |
OLD | NEW |