Greasemonkey Manual:Installing Scripts: Difference between revisions

From GreaseSpot Wiki
Jump to navigationJump to search
m Reverted edits by 69.157.137.115 (talk) to last revision by Arantius
No edit summary
 
(18 intermediate revisions by 9 users not shown)
Line 5: Line 5:
The purpose of [[Greasemonkey]] is to manage user scripts.
The purpose of [[Greasemonkey]] is to manage user scripts.
[[User script]]s allow the ''user'' to control the way they use the web, by customizing it with scripting.
[[User script]]s allow the ''user'' to control the way they use the web, by customizing it with scripting.
The [https://addons.mozilla.org/firefox/addon/748 Greasemonkey extension] won't do any good without any scripts installed.
The [https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/ Greasemonkey extension] won't do any good without any scripts installed.


The first thing an eager user should do is find and install ''(or write!)'' a useful script.
The first thing an eager user should do is find and install ''(or write!)'' a useful script.


:* A word on finding [[user script]]s. They may be located anywhere on the internet or even offline. The Greasemonkey community typically uses the general purpose user script repository site created for it at [http://userscripts.org/ http://userscripts.org].
:* A word on finding [[user script]]s. They may be located anywhere on the internet but you should look first at [[User_Script_Hosting|common hosts]].


Installation of a script is most often done by clicking a link on a web page. One may also drag-and-drop a local file into the browser window, or optionally use the menu bar [http://support.mozilla.com/en-US/kb/Menu+Reference#Open_File_ File → Open File...] dialog to open it.
Installation of a script is most often done by clicking a link on a web page.
<!-- Not in 4.0
One may also drag-and-drop a local file into the browser window, or optionally use the menu bar [http://support.mozilla.com/en-US/kb/Menu+Reference#Open_File_ File &rarr; Open File...] dialog to open it.
-->


:* Any file that ends in '''<code>.user.js</code>''' is a valid Greasemonkey user script.
:* Any file that ends in '''<code>.user.js</code>''' is a user script.


When the URL of a link is clicked or otherwise navigated to ends with <code>.user.js</code>, [[Greasemonkey]] will intercept the loading file by presenting the installation dialog.
When navigating to a URL which ends with <code>.user.js</code>, [[Greasemonkey]] will trigger the installation dialog.
Note that [[Greasemonkey]] must be [[Troubleshooting_(Users)#Greasemonkey Enabled Status|enabled]] to do so.


== The Installation Dialog ==
== The Installation Dialog ==
[[Image:Install-dialog.png|left|thumb|150px|GM Installation Dialog]]


When navigating to a [[user script]], Greasemonkey will open its installation dialog instead of loading the script like a normal page.
When navigating to a [[user script]], Greasemonkey will open its installation dialog instead of loading the script like a normal page.
A thumbnail of this dialog is shown to the left.
A thumbnail of this dialog is shown to the left.
It displays the name and description of the script, if available, as well as the [[include and exclude rules]] that apply.
It displays the name and description of the script as well as the [[include and exclude rules]] and special [[API]]s that apply.
<!-- Not in 4.0!
''Note:'' Greasemonkey must be  [[Troubleshooting (Users)#Greasemonkey Enabled Status|enabled]] to install scripts.
''Note:'' Greasemonkey must be  [[Troubleshooting (Users)#Greasemonkey Enabled Status|enabled]] to install scripts.
 
-->
[[Image:Install-dialog.png|left|thumb|150px|GM Installation Dialog]]


;* The Install button
;* The Install button
Line 33: Line 39:
This button will cancel the installation of a script.
This button will cancel the installation of a script.


<!-- Not in 4.0
;* The View Script Source button
;* The View Script Source button
This button will allow viewing of the source code contained in the script.
This button will allow viewing of the source code contained in the script.
Line 41: Line 48:
Clicking the install button here will also install the script.  
Clicking the install button here will also install the script.  


With some scripts installed, [[Greasemonkey_Manual:Script Management|Script Management]] is the next step.
-->
Now with some scripts installed, we can open the [[Greasemonkey Manual:Monkey Menu|Monkey Menu]] to list and manage them.

Latest revision as of 19:06, 3 November 2017


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

About User Scripts

The purpose of Greasemonkey is to manage user scripts. User scripts allow the user to control the way they use the web, by customizing it with scripting. The Greasemonkey extension won't do any good without any scripts installed.

The first thing an eager user should do is find and install (or write!) a useful script.

Installation of a script is most often done by clicking a link on a web page.

  • Any file that ends in .user.js is a user script.

When navigating to a URL which ends with .user.js, Greasemonkey will trigger the installation dialog. Note that Greasemonkey must be enabled to do so.

The Installation Dialog

GM Installation Dialog

When navigating to a user script, Greasemonkey will open its installation dialog instead of loading the script like a normal page. A thumbnail of this dialog is shown to the left. It displays the name and description of the script as well as the include and exclude rules and special APIs that apply.

  • The Install button

This button will, of course, install the script in question. Like the Firefox extension installation dialog, this button is disabled for a few seconds to avoid the same potential security vulnerability.

  • The Cancel button

This button will cancel the installation of a script.

Now with some scripts installed, we can open the Monkey Menu to list and manage them.