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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 status: Cr.NS_OK, | 132 status: Cr.NS_OK, |
133 | 133 |
134 _getResponse: notImplemented, | 134 _getResponse: notImplemented, |
135 | 135 |
136 _checkSecurity: function() | 136 _checkSecurity: function() |
137 { | 137 { |
138 if (!this.loadInfo.triggeringPrincipal.equals(Utils.systemPrincipal)) | 138 if (!this.loadInfo.triggeringPrincipal.equals(Utils.systemPrincipal)) |
139 throw Cr.NS_ERROR_FAILURE; | 139 throw Cr.NS_ERROR_FAILURE; |
140 }, | 140 }, |
141 | 141 |
142 asyncOpen: function() | 142 asyncOpen: function(listener, context) |
143 { | 143 { |
144 Promise.resolve(this._getResponse()).then(data => | 144 Promise.resolve(this._getResponse()).then(data => |
145 { | 145 { |
146 let stream = Cc["@mozilla.org/io/string-input-stream;1"] | 146 let stream = Cc["@mozilla.org/io/string-input-stream;1"] |
147 .createInstance(Ci.nsIStringInputStream); | 147 .createInstance(Ci.nsIStringInputStream); |
148 stream.setData(data, data.length); | 148 stream.setData(data, data.length); |
149 | 149 |
150 try | 150 try |
151 { | 151 { |
152 listener.onStartRequest(this, context); | 152 listener.onStartRequest(this, context); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 return new Promise((resolve, reject) => | 286 return new Promise((resolve, reject) => |
287 { | 287 { |
288 let window = Utils.getRequestWindow(this); | 288 let window = Utils.getRequestWindow(this); |
289 shouldAllowAsync(window, window.document, "ELEMHIDE", this.key, allow => | 289 shouldAllowAsync(window, window.document, "ELEMHIDE", this.key, allow => |
290 { | 290 { |
291 resolve(allow ? allowXBL : hideXBL); | 291 resolve(allow ? allowXBL : hideXBL); |
292 }); | 292 }); |
293 }); | 293 }); |
294 } | 294 } |
295 }; | 295 }; |
OLD | NEW |