| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 { | 122 { |
| 123 if (subject.wrappedJSObject) | 123 if (subject.wrappedJSObject) |
| 124 subject = subject.wrappedJSObject; | 124 subject = subject.wrappedJSObject; |
| 125 | 125 |
| 126 if (subject.addonInfo) | 126 if (subject.addonInfo) |
| 127 subject.addonInfo.adblockplus = getContextInfo(subject.event); | 127 subject.addonInfo.adblockplus = getContextInfo(subject.event); |
| 128 }, | 128 }, |
| 129 QueryInterface: XPCOMUtils.generateQI([Ci.nsISupportsWeakReference, Ci.nsIObse
rver]) | 129 QueryInterface: XPCOMUtils.generateQI([Ci.nsISupportsWeakReference, Ci.nsIObse
rver]) |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 let addObserver = Utils.getPropertyWithoutCompatShims(Services.obs, "addObserver
"); | 132 Services.obs.addObserver(ContextMenuObserver, "content-contextmenu", true); |
| 133 addObserver.call(Services.obs, ContextMenuObserver, "content-contextmenu", true)
; | 133 Services.obs.addObserver(ContextMenuObserver, "AdblockPlus:content-contextmenu",
true); |
| 134 addObserver.call(Services.obs, ContextMenuObserver, "AdblockPlus:content-context
menu", true); | |
| 135 onShutdown.add(() => { | 134 onShutdown.add(() => { |
| 136 let removeObserver = Utils.getPropertyWithoutCompatShims(Services.obs, "remove
Observer"); | 135 Services.obs.removeObserver(ContextMenuObserver, "content-contextmenu"); |
| 137 removeObserver.call(Services.obs, ContextMenuObserver, "content-contextmenu"); | 136 Services.obs.removeObserver(ContextMenuObserver, "AdblockPlus:content-contextm
enu"); |
| 138 removeObserver.call(Services.obs, ContextMenuObserver, "AdblockPlus:content-co
ntextmenu"); | |
| 139 }); | 137 }); |
| OLD | NEW |