Greasemonkey Manual:Monkey Menu: Difference between revisions

From GreaseSpot Wiki
Jump to navigationJump to search
m (Reverted edits by 125.165.165.132 (Talk) to last revision by 71.108.13.80)
(revamp for toolbar-button-ness as in 0.9.2)
Line 7: Line 7:
Clicking on the monkey would toggle the global enabled status of [[Greasemonkey]].
Clicking on the monkey would toggle the global enabled status of [[Greasemonkey]].
When enabled, the monkey is displayed in color; when disabled, it is greyed out, and no [[user script]]s will run.
When enabled, the monkey is displayed in color; when disabled, it is greyed out, and no [[user script]]s will run.
When [http://support.mozilla.com/en-US/kb/what-happened-status-bar Firefox 4 removed the status bar], Greasemonkey followed suit.
Greasemonkey [[Version history#0.9.2|0.9.2]] added a toolbar button instead, and removed the status bar icon (in Firefox 4; it is still present in Firefox 3 which still has the status bar).
You can read [http://wiki.greasespot.net/index.php?title=Greasemonkey_Manual:Monkey_Menu&oldid=6034 this page's history] to learn about the old status bar icon and its menu.


== The Menu ==
== The Menu ==


[[Image:Monkey-menu-0.8.4.png|left|frame|GM "Monkey Menu"]]
[[Image:Win7-ff4-toolbar-monkey-menu.png|center|frame|Greasemonkey's "Monkey Menu"]]


Later versions of [[Greasemonkey]] added a menu to this, and it was dubbed the Monkey Menu.
As of Greasemonkey 0.9.2, the same menu is available under Tools > Greasemonkey, and attached to the toolbar icon.
This menu largely mirrors that menu which is available under the <code>Tools</code> menu.
(Also: from the status bar icon in Firefox 3.)


The <code>Enabled</code> menu item will display, as well as control, Greasemonkey's global enabled status.
The <code>Manage User Scripts...</code> menu item will open the [[Greasemonkey Manual:Manage Dialog|manage dialog]] as described earlier.
The <code>Manage User Scripts...</code> menu item will open the [[Greasemonkey Manual:Manage Dialog|manage dialog]] as described earlier.
The <code>New User Script...</code> menu item is used to ''write'' a new user script, from scratch.
The <code>New User Script...</code> menu item is used to ''write'' a new user script, from scratch.
It is described in more detail in the [[Greasemonkey Manual:Editing#New User Script|editing]] section of this manual.
It is described in more detail in the [[Greasemonkey Manual:Editing|editing]] section of this manual.
 
This menu also provides a list of the scripts whose [[include and exclude rules]] match the current page.
Clicking on any script listed here is a convenient shortcut to enable/disable exactly that script.
The menu item shows a check mark next to enabled scripts, and none next to disabled scripts.
Pro tip: Right click on a script in this list and your editor will be opened to the main <code>.user.js</code> file for this script.


This menu provides a list of the scripts whose [[include and exclude rules]] match the current page.
=== The Toolbar Button ===
Each script listed here functions as a checkbox control, and the scripts can be individually enabled or disabled by clicking on them here.


The monkey menu also adds a menu item to explicitly display, as well as control, the global enabled status.
The Greasemonkey toolbar button will be inserted into your browser's navigation bar at far right once, the first time that you run Greasemonkey.
You can [http://support.mozilla.com/en-US/kb/how-do-i-customize-toolbars customize the toolbar] (right click and choose "Customize") to move or remove the button as you please from this point.


=== User Script Commands ===
=== User Script Commands ===
The <code>User Script Commands...</code> sub-menu lists the menu items for individual scripts which have been added via the [[GM_registerMenuCommand]]. The presence and/or contents (as well as the possible actions) of this sub-menu depend completely on which scripts have been installed.
 
The <code>User Script Commands...</code> sub-menu lists the menu items for individual scripts which have been added via the [[GM_registerMenuCommand]] API.
The presence and/or contents (as well as the possible actions) of this sub-menu depend completely on which scripts have been installed.
It is common for this sub-menu to be unavailable and greyed out.
It is common for this sub-menu to be unavailable and greyed out.
== Shortcuts ==
There are a few other "hidden" shortcuts in the monkey menu.
First, a middle-click (the scroll wheel usually functions as a middle button, if the mouse has one) on the monkey icon will open the [[Greasemonkey Manual:Manage Dialog|manage dialog]].
Second, a right-click on a script in the list will fire up the text editor (see the edit button in the "Manage Dialog" section) on the script that is clicked.
These shortcuts (especially the latter) are designed for advanced users. However they can be very handy!
== No Scripts Installed ==
It's possible for the monkey menu to show "No Scripts Installed!" even when there '''are''' scripts installed.
This is an issue of semantics.
The monkey menu displays only scripts that run on the currently visible tab, and this message is shown when no scripts match that criteria.

Revision as of 14:43, 14 April 2011


Greasemonkey Manual
Using Greasemonkey
Installing Scripts
Monkey Menu
Getting Help
User Script Authoring
Editing
Environment
API

The Monkey

Early versions of Greasemonkey provided an image of a monkey in the status bar. Clicking on the monkey would toggle the global enabled status of Greasemonkey. When enabled, the monkey is displayed in color; when disabled, it is greyed out, and no user scripts will run.

When Firefox 4 removed the status bar, Greasemonkey followed suit. Greasemonkey 0.9.2 added a toolbar button instead, and removed the status bar icon (in Firefox 4; it is still present in Firefox 3 which still has the status bar). You can read this page's history to learn about the old status bar icon and its menu.

The Menu

Greasemonkey's "Monkey Menu"

As of Greasemonkey 0.9.2, the same menu is available under Tools > Greasemonkey, and attached to the toolbar icon. (Also: from the status bar icon in Firefox 3.)

The Enabled menu item will display, as well as control, Greasemonkey's global enabled status. The Manage User Scripts... menu item will open the manage dialog as described earlier. The New User Script... menu item is used to write a new user script, from scratch. It is described in more detail in the editing section of this manual.

This menu also provides a list of the scripts whose include and exclude rules match the current page. Clicking on any script listed here is a convenient shortcut to enable/disable exactly that script. The menu item shows a check mark next to enabled scripts, and none next to disabled scripts. Pro tip: Right click on a script in this list and your editor will be opened to the main .user.js file for this script.

The Toolbar Button

The Greasemonkey toolbar button will be inserted into your browser's navigation bar at far right once, the first time that you run Greasemonkey. You can customize the toolbar (right click and choose "Customize") to move or remove the button as you please from this point.

User Script Commands

The User Script Commands... sub-menu lists the menu items for individual scripts which have been added via the GM_registerMenuCommand API. The presence and/or contents (as well as the possible actions) of this sub-menu depend completely on which scripts have been installed. It is common for this sub-menu to be unavailable and greyed out.