Index: lib/ui.js |
=================================================================== |
--- a/lib/ui.js |
+++ b/lib/ui.js |
@@ -1595,24 +1595,33 @@ let UI = exports.UI = |
/** |
* Adds Adblock Plus menu items to the content area context menu when it shows |
* up. |
*/ |
fillContentContextMenu: function(/**Element*/ popup) |
{ |
let window = popup.ownerDocument.defaultView; |
- if (!window.gContextMenuContentData || |
- typeof window.gContextMenuContentData.addonInfo != "object" || |
- typeof window.gContextMenuContentData.addonInfo.adblockplus != "object") |
+ let data = window.gContextMenuContentData; |
+ if (!data) |
{ |
- return; |
+ // This is SeaMonkey Mail or Thunderbird, they won't get context menu data |
+ // for us. Send the notification ourselves. |
+ data = { |
+ event: {target: popup.triggerNode}, |
+ addonInfo: {}, |
+ get wrappedJSObject() {return this;} |
+ }; |
+ Services.obs.notifyObservers(data, "AdblockPlus:content-contextmenu", null); |
} |
- let items = window.gContextMenuContentData.addonInfo.adblockplus; |
+ if (typeof data.addonInfo != "object" || typeof data.addonInfo.adblockplus != "object") |
+ return; |
+ |
+ let items = data.addonInfo.adblockplus; |
let clicked = null; |
let menuItems = []; |
function menuItemTriggered(id, nodeData) |
{ |
clicked = id; |
this.blockItem(window, id, nodeData); |
} |