MozillaZine

mozilla.org Branches for 1.0

Tuesday April 9th, 2002

mozilla.org today cut the MOZILLA_1_0_0_BRANCH for 1.0 to use. Expect to see an RC1 candidate sometime next week in order to see where the builds are as far as stability and usability. Work will continue on the branch up until the final 1.0 release, and beyond for point releases. An updated roadmap will be posted soon reflecting this. The trunk is now open to 1.1 alpha work, on the road to 2.0!


#70 Each to their own.

by TimHunt <T.J.Hunt@open.ac.uk>

Friday April 12th, 2002 3:09 AM

You are replying to this message

I personally, think that Back and Forward in the context menu is stupid, but the beauty of mozilla is that the interface is all in XUL/JS so you can easily change it to suit yourself with nothing more than a zip utility and a text editor. All it takes is for someone who thinks that this is a good idea to work out how and write a little script to do it.

To start with I am a programmer, but I don't know much about how Mozilla works. And you probably need to get patchmaker <http://www.gerv.net/softw…tch-maker/build-mode.html> since that is the easiest way to get the chrome files into a form where you can hack around with them.

It looks like the context menu is defined in the file \comm\content\communicator\contentAreaContextOverlay.xul, but this file just defines all the possible entries, they are hidden or shown elsewhere. Anyway, the bit of code we are interested in is

<menuitem id="context-back" label="&goBackCmd.label;" accesskey="&goBackCmd.accesskey;" oncommand="BrowserBack()"/> <menuitem id="context-forward" label="&goForwardCmd.label;" accesskey="&goForwardCmd.accesskey;" oncommand="BrowserForward()"/> <menuitem id="context-reload" label="&reloadCmd.label;" accesskey="&reloadCmd.accesskey;" oncommand="BrowserReload();"/> <menuitem id="context-stop" label="&stopCmd.label;" accesskey="&stopCmd.accesskey;" disabled="true" oncommand="BrowserStop();"/>

That is, we are now looking for the code that messes with the things with id context-back. A quick search throught the other files suggests that the code we want is in nsContextMenu.js and looks like this:

initNavigationItems : function () { // Back determined by canGoBack broadcaster. this.setItemAttrFromNode( "context-back", "disabled", "canGoBack" );

// Forward determined by canGoForward broadcaster. this.setItemAttrFromNode( "context-forward", "disabled", "canGoForward" ); this.showItem( "context-back", !( this.isTextSelected || this.onLink || this.onImage || this.onTextInput ) ); this.showItem( "context-forward", !( this.isTextSelected || this.onLink || this.onImage || this.onTextInput ) );

this.showItem( "context-reload", !( this.isTextSelected || this.onLink || this.onImage || this.onTextInput ) ); this.showItem( "context-stop", !( this.isTextSelected || this.onLink || this.onImage || this.onTextInput ) ); this.showItem( "context-sep-stop", !( this.isTextSelected || this.onLink || this.onImage || this.onTextInput ) );

// XXX: Stop is determined in navigator.js; the canStop broadcaster is broken //this.setItemAttrFromNode( "context-stop", "disabled", "canStop" ); },

I would guess that changing some of those compicated logical conditions to just read "true" or "false" would do what you want.

I have not tried this yet since that would require exiting Mozilla, I'll report back soon. Tim.