| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 /** | 65 /** |
| 66 * Called on module startup, initializes various exported properties. | 66 * Called on module startup, initializes various exported properties. |
| 67 */ | 67 */ |
| 68 init: function() | 68 init: function() |
| 69 { | 69 { |
| 70 // whitelisted URL schemes | 70 // whitelisted URL schemes |
| 71 for (let scheme of Prefs.whitelistschemes.toLowerCase().split(" ")) | 71 for (let scheme of Prefs.whitelistschemes.toLowerCase().split(" ")) |
| 72 this.whitelistSchemes.add(scheme); | 72 this.whitelistSchemes.add(scheme); |
| 73 | 73 |
| 74 Utils.addChildMessageListener("AdblockPlus:ShouldAllow", this.shouldAllow.bi
nd(this)); | 74 Utils.addChildMessageListener("AdblockPlus:ShouldAllow", message => this.sho
uldAllow(message)); |
| 75 | 75 |
| 76 // Generate class identifier used to collapse nodes and register | 76 // Generate class identifier used to collapse nodes and register |
| 77 // corresponding stylesheet. | 77 // corresponding stylesheet. |
| 78 let collapsedClass = ""; | 78 let collapsedClass = ""; |
| 79 let offset = "a".charCodeAt(0); | 79 let offset = "a".charCodeAt(0); |
| 80 for (let i = 0; i < 20; i++) | 80 for (let i = 0; i < 20; i++) |
| 81 collapsedClass += String.fromCharCode(offset + Math.random() * 26); | 81 collapsedClass += String.fromCharCode(offset + Math.random() * 26); |
| 82 Utils.addChildMessageListener("AdblockPlus:GetCollapsedClass", () => collaps
edClass); | 82 Utils.addChildMessageListener("AdblockPlus:GetCollapsedClass", () => collaps
edClass); |
| 83 | 83 |
| 84 let collapseStyle = Services.io.newURI("data:text/css," + | 84 let collapseStyle = Services.io.newURI("data:text/css," + |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 { | 395 { |
| 396 // EffectiveTLDService throws on IP addresses, just compare the host name | 396 // EffectiveTLDService throws on IP addresses, just compare the host name |
| 397 let host = ""; | 397 let host = ""; |
| 398 try | 398 try |
| 399 { | 399 { |
| 400 host = uri.host; | 400 host = uri.host; |
| 401 } catch (e) {} | 401 } catch (e) {} |
| 402 return host != docDomain; | 402 return host != docDomain; |
| 403 } | 403 } |
| 404 } | 404 } |
| OLD | NEW |