Permalink
Browse files

Allow to access menu elements of the page context menu

  • Loading branch information...
1 parent 6b23c8c commit d834b430862b3cc236811c984d72904d51fecf37 @SebastianZ SebastianZ committed Mar 28, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 tests/FBTest/content/FBTestFirebug.js
@@ -2145,7 +2145,9 @@ this.selectElementInHtmlPanel = function(element, callback)
*/
this.executeContextMenuCommand = function(target, menuItemIdentifier, callback)
{
- var contextMenu = FW.FBL.$("fbContextMenu");
+ var contextMenu = target.ownerDocument.documentURI == "chrome://firebug/content/panel.html" ?
+ FW.FBL.$("fbContextMenu") : FW.Firebug.chrome.window.top.window.document.
+ getElementById("contentAreaContextMenu");
var self = this;
function onPopupShown(event)
@@ -2159,7 +2161,7 @@ this.executeContextMenuCommand = function(target, menuItemIdentifier, callback)
if (typeof menuItemIdentifier == "string" || menuItemIdentifier.id)
{
var menuItemId = menuItemIdentifier.id || menuItemIdentifier;
- menuItem = contextMenu.ownerDocument.getElementById((menuItemId));
+ menuItem = contextMenu.ownerDocument.getElementById(menuItemId);
}
else if (menuItemIdentifier.label)
{
@@ -2201,7 +2203,7 @@ this.executeContextMenuCommand = function(target, menuItemIdentifier, callback)
contextMenu.addEventListener("popupshown", onPopupShown, false);
// Right click on the target element.
- var eventDetails = {type : "contextmenu", button : 2};
+ var eventDetails = {type: "contextmenu", button: 2};
this.synthesizeMouse(target, 2, 2, eventDetails);
};

0 comments on commit d834b43

Please sign in to comment.