Open Bug 596679 Opened 13 years ago Updated 5 months ago

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


(Firefox :: Menus, defect)

3.6 Branch
Windows 7





(Reporter: lists, Unassigned)


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv: Gecko/20100824 Firefox/3.6.9
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv: 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.


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
Version: unspecified → 3.6 Branch
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.