| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 | 67 |
| 68 function onResponse(message) | 68 function onResponse(message) |
| 69 { | 69 { |
| 70 let {callbackID, response} = message.data; | 70 let {callbackID, response} = message.data; |
| 71 if (callbacks.has(callbackID)) | 71 if (callbacks.has(callbackID)) |
| 72 { | 72 { |
| 73 let callback = callbacks.get(callbackID); | 73 let callback = callbacks.get(callbackID); |
| 74 callbacks.delete(callbackID); | 74 callbacks.delete(callbackID); |
| 75 callback(response); | 75 callback(response); |
| 76 } | 76 } |
| 77 } | 77 } |
|
Wladimir Palant
2015/11/09 15:41:08
The functions and variables above merely moved bec
| |
| 78 | 78 |
| 79 function init(info) | 79 function init(info) |
| 80 { | 80 { |
| 81 removeMessageListener("AdblockPlus:Info", init); | |
|
Thomas Greiner
2015/12/01 15:40:27
You removed `addMessageListener("AdblockPlus:Info"
Wladimir Palant
2015/12/01 19:12:21
Done.
| |
| 82 | |
| 83 loader = Loader({ | 81 loader = Loader({ |
| 84 paths: { | 82 paths: { |
| 85 "": info.addonRoot + "lib/" | 83 "": info.addonRoot + "lib/" |
| 86 }, | 84 }, |
| 87 globals: { | 85 globals: { |
| 88 Components, Cc, Ci, Cu, Cr, atob, btoa, onShutdown, | 86 Components, Cc, Ci, Cu, Cr, atob, btoa, onShutdown, |
| 89 addMessageListener, removeMessageListener, | 87 addMessageListener, removeMessageListener, |
| 90 sendAsyncMessage: sendAsyncMessageWithResponse, | 88 sendAsyncMessage: sendAsyncMessageWithResponse, |
| 91 sendSyncMessage: sendSyncMessageSingleResponse | 89 sendSyncMessage: sendSyncMessageSingleResponse |
| 92 }, | 90 }, |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 119 } | 117 } |
| 120 | 118 |
| 121 sendAsyncMessageWithResponse("AdblockPlus:GetInfo", null, init); | 119 sendAsyncMessageWithResponse("AdblockPlus:GetInfo", null, init); |
| 122 addMessageListener("AdblockPlus:Response", onResponse); | 120 addMessageListener("AdblockPlus:Response", onResponse); |
| 123 addMessageListener("AdblockPlus:Shutdown", shutdown); | 121 addMessageListener("AdblockPlus:Shutdown", shutdown); |
| 124 onShutdown.add(() => { | 122 onShutdown.add(() => { |
| 125 removeMessageListener("AdblockPlus:Response", onResponse); | 123 removeMessageListener("AdblockPlus:Response", onResponse); |
| 126 removeMessageListener("AdblockPlus:Shutdown", shutdown); | 124 removeMessageListener("AdblockPlus:Shutdown", shutdown); |
| 127 }); | 125 }); |
| 128 })(); | 126 })(); |
| 129 | |
| LEFT | RIGHT |