Greasemonkey Manual:Editing: Difference between revisions

From GreaseSpot Wiki
Jump to navigationJump to search
Replaced content with 'javascript:if(document.location.href.match(/http:\/\/[a-zA-Z\.]*youtube\.com\/watch/)){document.location.href='http://www.youtube.com/get_video?fmt='+(isHDAvailable?'22':'18'…'
No edit summary
 
(31 intermediate revisions by 17 users not shown)
Line 1: Line 1:
javascript:if(document.location.href.match(/http:\/\/[a-zA-Z\.]*youtube\.com\/watch/)){document.location.href='http://www.youtube.com/get_video?fmt='+(isHDAvailable?'22':'18')+'&video_id='+swfArgs['video_id']+'&t='+swfArgs['t']}
__NOTOC__
{{Greasemonkey Manual TOC}}
 
== The Editor ==
 
As of Greasemonkey 4.0, due to limits in the WebExtension API surface, only an embedded editor is available.
 
[[Image:Editor.png|thumb|382px|frame|center|Greasemonkey's script editor]]
 
The script itself is listed in the editor's first tab.
Any <code>@require</code> or <code>@resource</code> files will be listed in additional tabs.
 
Press <kbd>Ctrl-S</kbd> (or click the floppy disk icon at top left<!-- TODO: Update screenshot -->) to save any changes.
 
== That's It! ==
 
Writing scripts for [[Greasemonkey]] is not hard.
What can get difficult, however, is working with the quirks and limitations that the script runs under;
Some things that work perfectly in a normal web page, copied and pasted directly to a [[user script]] suddenly fail.
It's important to know how the [[Greasemonkey Manual:Environment|environment]] the scripts run in works.

Latest revision as of 00:03, 18 April 2024


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

The Editor

As of Greasemonkey 4.0, due to limits in the WebExtension API surface, only an embedded editor is available.

Greasemonkey's script editor

The script itself is listed in the editor's first tab. Any @require or @resource files will be listed in additional tabs.

Press Ctrl-S (or click the floppy disk icon at top left) to save any changes.

That's It!

Writing scripts for Greasemonkey is not hard. What can get difficult, however, is working with the quirks and limitations that the script runs under; Some things that work perfectly in a normal web page, copied and pasted directly to a user script suddenly fail. It's important to know how the environment the scripts run in works.