| 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 11 matching lines...) Expand all Loading... |
| 22 var MessageProxy = ext._MessageProxy = function(messageDispatcher) | 22 var MessageProxy = ext._MessageProxy = function(messageDispatcher) |
| 23 { | 23 { |
| 24 this._messageDispatcher = messageDispatcher; | 24 this._messageDispatcher = messageDispatcher; |
| 25 this._responseCallbacks = Object.create(null); | 25 this._responseCallbacks = Object.create(null); |
| 26 this._responseCallbackCounter = 0; | 26 this._responseCallbackCounter = 0; |
| 27 }; | 27 }; |
| 28 MessageProxy.prototype = { | 28 MessageProxy.prototype = { |
| 29 _sendResponse: function(request, message) | 29 _sendResponse: function(request, message) |
| 30 { | 30 { |
| 31 var response = {}; | 31 var response = {}; |
| 32 |
| 33 if ("documentId" in request) |
| 34 response["targetDocuments"] = [request["documentId"]]; |
| 35 |
| 32 for (var prop in request) | 36 for (var prop in request) |
| 33 response[prop] = request[prop]; | 37 response[prop] = request[prop]; |
| 34 response.payload = message; | 38 response.payload = message; |
| 35 | 39 |
| 36 this._messageDispatcher.dispatchMessage("response", response); | 40 this._messageDispatcher.dispatchMessage("response", response); |
| 37 }, | 41 }, |
| 38 handleRequest: function(request, sender) | 42 handleRequest: function(request, sender) |
| 39 { | 43 { |
| 40 if ("callbackId" in request) | 44 if ("callbackId" in request) |
| 41 { | 45 { |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 }; | 218 }; |
| 215 | 219 |
| 216 | 220 |
| 217 /* Utils */ | 221 /* Utils */ |
| 218 | 222 |
| 219 ext.getURL = function(path) | 223 ext.getURL = function(path) |
| 220 { | 224 { |
| 221 return safari.extension.baseURI + path; | 225 return safari.extension.baseURI + path; |
| 222 }; | 226 }; |
| 223 })(); | 227 })(); |
| OLD | NEW |