context-back menu item is arbitrarily unhidden when context menu is shown

UNCONFIRMED
Unassigned

Status

()

Firefox
Menus
UNCONFIRMED
8 years ago
7 years ago

People

(Reporter: tpdi, Unassigned)

Tracking

3.6 Branch
x86
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9

The xul element "context-back" (the "Back" menuitem on the right click context menu) has its attribute "hidden" removed when the right-click context menu is set. This makes it difficult for, e.g., an extension to hide the "context-back" menu item.

Workarounds:

1) set the attribute "collapsed"; this results in the element being in the box model but not shown
document.getElementById( "context-back" ).setAttribute( "collapsed", true );

2) intercept the code that shows the right-click context menu, allow the code to unhide "context-back" as normal, rehide context-back before the menu is shown:

var cacm = document.getElementById( "contentAreaContextMenu" );
var originalContextMenuOnPopUpShowing 
  = new Function( "event", cacm.getAttribute( ONPOPUPSHOWING ) );
cacm.setAttribute( ONPOPUPSHOWING, 
  new Function( "event" ,
   " var ret = originalContextMenuOnPopUpShowing( event ) ;"
   + " document.getElementById( 'context-back' ).setAttribute( 'hidden', true);
   + " return ret ;" );"
  ) );
 

Reproducible: Always

Steps to Reproduce:
1. set context-back's hidden attribute
2. right click in content area 

Actual Results:  
context-back is shown in the context menu

Expected Results:  
context-back should remain hidden

Updated

7 years ago
Version: unspecified → 3.6 Branch
You need to log in before you can comment on or make changes to this bug.