Menu customization: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
Line 9: Line 9:


[http://piro.sakura.ne.jp/xul/doc/ctxextensions/help.xml.en This extension] allows context menu items to be added according to [[:Category:ContextMenu Extensions script|user-defined scripts]], offering the possibility for the user to add, for example, a context menu item which appends text to the beginning, middle, or end of a right-clicked URL to allow the predictably modified URL to appear in a new window. Along these lines and of perhaps special interest to wiki users are the [[CMEScript:Edit wiki|Edit wiki scripts]] which can be added within the extension to allow the user the option to immediately jump to the edit page of a right-clicked wiki article (i.e., without needing to first go to the article and then click to edit the page, if one already knew one would wish to edit the article or see its wiki code).
[http://piro.sakura.ne.jp/xul/doc/ctxextensions/help.xml.en This extension] allows context menu items to be added according to [[:Category:ContextMenu Extensions script|user-defined scripts]], offering the possibility for the user to add, for example, a context menu item which appends text to the beginning, middle, or end of a right-clicked URL to allow the predictably modified URL to appear in a new window. Along these lines and of perhaps special interest to wiki users are the [[CMEScript:Edit wiki|Edit wiki scripts]] which can be added within the extension to allow the user the option to immediately jump to the edit page of a right-clicked wiki article (i.e., without needing to first go to the article and then click to edit the page, if one already knew one would wish to edit the article or see its wiki code).
[[Category:Firefox extension]]


==Various Other Extensions==
==Various Other Extensions==

Revision as of 08:16, 9 December 2005

There are several ways to tweak menus of your XUL-based application, like Mozilla Suite, Thunderbird or Firefox.

Menu Editor extension

If you use Firefox or Thunderbird, you can install Menu Editor extension, which allows you hide the menu items as well as reorder them.

Post your feedback in Menu Editor discussion thread on MozillaZine forums.

ContextMenu Extensions extension

This extension allows context menu items to be added according to user-defined scripts, offering the possibility for the user to add, for example, a context menu item which appends text to the beginning, middle, or end of a right-clicked URL to allow the predictably modified URL to appear in a new window. Along these lines and of perhaps special interest to wiki users are the Edit wiki scripts which can be added within the extension to allow the user the option to immediately jump to the edit page of a right-clicked wiki article (i.e., without needing to first go to the article and then click to edit the page, if one already knew one would wish to edit the article or see its wiki code).

Various Other Extensions

Assorted extensions may add context menus (or general menu items) depending on the extension.

Context menu extensions which allow customization of the context menu include:

  • Context Search - Adds search plugins (which are customizable) to the context menu (searches highlighted text).
  • Dictionary Search - Allows searching of user-defined websites (not only dictionaries) through wildcard (works on selected text, not a selected link)
  • Ook - Allows bookmarks (which are of course customizable by the user) to be added to the context menu

Wiki/Forum-relevant extensions

This Wikipedia extension (presently not updated to work with Firefox 1.5) allowed wiki code to be accessible from the context menu.

Another useful extension for wiki editing is the "Save Text Area" extension which allows saving text from and loading text into textboxes, now updated for 1.5.

Tweaking userChrome.css

If you don't want to install Menu Editor, you can tweak your menus using userChrome.css. First locate your profile folder. There's a subfolder called "chrome". What you need to do is edit the "userChrome.css" file (create it if it does not exists).

Using ID selectors

Add a line like this to hide any menu item:

#id1, #id2 { display:none !important; }

replacing each of the identifiers #id1, #id2, ... with one of the selectors from UserChrome.css Element Names/IDs#Firefox menus.

Example (hides the "View Background" menu item and the horizontal line after it):

#context-viewbgimage,
#context-sep-viewbgimage {
  display: none !important;
}

Using attribute selectors

Another way to change the style of a menu item is to use the label attribute selector.

For example, if you want to hide the "Close Tab" menu item on the tab bar context menu:

menuitem[label="Close Tab"] {
    display: none !important;
}

or if you want to change the "For Internet Explorer Users" appearance on the "Help" menu:

menuitem[label="For Internet Explorer Users"] {
    text-decoration: line-through !important;
}