Index: lib/child/contextMenu.js |
=================================================================== |
--- a/lib/child/contextMenu.js |
+++ b/lib/child/contextMenu.js |
@@ -124,16 +124,14 @@ let ContextMenuObserver = |
subject = subject.wrappedJSObject; |
if (subject.addonInfo) |
subject.addonInfo.adblockplus = getContextInfo(subject.event); |
}, |
QueryInterface: XPCOMUtils.generateQI([Ci.nsISupportsWeakReference, Ci.nsIObserver]) |
}; |
-let addObserver = Utils.getPropertyWithoutCompatShims(Services.obs, "addObserver"); |
-addObserver.call(Services.obs, ContextMenuObserver, "content-contextmenu", true); |
-addObserver.call(Services.obs, ContextMenuObserver, "AdblockPlus:content-contextmenu", true); |
+Services.obs.addObserver(ContextMenuObserver, "content-contextmenu", true); |
+Services.obs.addObserver(ContextMenuObserver, "AdblockPlus:content-contextmenu", true); |
onShutdown.add(() => { |
- let removeObserver = Utils.getPropertyWithoutCompatShims(Services.obs, "removeObserver"); |
- removeObserver.call(Services.obs, ContextMenuObserver, "content-contextmenu"); |
- removeObserver.call(Services.obs, ContextMenuObserver, "AdblockPlus:content-contextmenu"); |
+ Services.obs.removeObserver(ContextMenuObserver, "content-contextmenu"); |
+ Services.obs.removeObserver(ContextMenuObserver, "AdblockPlus:content-contextmenu"); |
}); |