| 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 12 matching lines...) Expand all Loading... |
| 23 remove() {} | 23 remove() {} |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 // | 26 // |
| 27 // XPCOM emulation | 27 // XPCOM emulation |
| 28 // | 28 // |
| 29 | 29 |
| 30 function nsIFileURL() {} | 30 function nsIFileURL() {} |
| 31 function nsIHttpChannel() {} | 31 function nsIHttpChannel() {} |
| 32 | 32 |
| 33 let Components = { | 33 let ComponentsObject = { |
| 34 interfaces: | 34 interfaces: |
| 35 { | 35 { |
| 36 nsIFile: {DIRECTORY_TYPE: 0}, | 36 nsIFile: {DIRECTORY_TYPE: 0}, |
| 37 nsIFileURL, | 37 nsIFileURL, |
| 38 nsIHttpChannel, | 38 nsIHttpChannel, |
| 39 nsITimer: {TYPE_REPEATING_SLACK: 0}, | 39 nsITimer: {TYPE_REPEATING_SLACK: 0}, |
| 40 nsIInterfaceRequestor: null, | 40 nsIInterfaceRequestor: null, |
| 41 nsIChannelEventSink: null | 41 nsIChannelEventSink: null |
| 42 }, | 42 }, |
| 43 classes: | 43 classes: |
| (...skipping 22 matching lines...) Expand all Loading... |
| 66 }, | 66 }, |
| 67 reportError(e) | 67 reportError(e) |
| 68 { | 68 { |
| 69 console.error(e); | 69 console.error(e); |
| 70 console.trace(); | 70 console.trace(); |
| 71 } | 71 } |
| 72 }, | 72 }, |
| 73 manager: null, | 73 manager: null, |
| 74 ID() { return null; } | 74 ID() { return null; } |
| 75 }; | 75 }; |
| 76 const Cc = Components.classes; | 76 const Cc = ComponentsObject.classes; |
| 77 const Ci = Components.interfaces; | 77 const Ci = ComponentsObject.interfaces; |
| 78 const Cr = Components.results; | 78 const Cr = ComponentsObject.results; |
| 79 const Cu = Components.utils; | 79 const Cu = ComponentsObject.utils; |
| 80 | 80 |
| 81 Cu.import.resources = new Map(); | 81 Cu.import.resources = new Map(); |
| 82 | 82 |
| 83 Cu.import.resources.set("XPCOMUtils", { | 83 Cu.import.resources.set("XPCOMUtils", { |
| 84 generateQI() {} | 84 generateQI() {} |
| 85 }); | 85 }); |
| 86 | 86 |
| 87 // | 87 // |
| 88 // Services.jsm module emulation | 88 // Services.jsm module emulation |
| 89 // | 89 // |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 status: -1, | 209 status: -1, |
| 210 notificationCallbacks: {}, | 210 notificationCallbacks: {}, |
| 211 loadFlags: 0, | 211 loadFlags: 0, |
| 212 INHIBIT_CACHING: 0, | 212 INHIBIT_CACHING: 0, |
| 213 VALIDATE_ALWAYS: 0, | 213 VALIDATE_ALWAYS: 0, |
| 214 QueryInterface() | 214 QueryInterface() |
| 215 { | 215 { |
| 216 return this; | 216 return this; |
| 217 } | 217 } |
| 218 }; | 218 }; |
| OLD | NEW |