https://wiki.greasespot.net/api.php?action=feedcontributions&user=Kwah&feedformat=atomGreaseSpot Wiki - User contributions [en]2024-03-29T09:54:02ZUser contributionsMediaWiki 1.41.0https://wiki.greasespot.net/index.php?title=Greasemonkey_Manual:API&diff=6625Greasemonkey Manual:API2011-08-11T22:46:56Z<p>Kwah: Undo revision 6623 by 114.40.156.19 (talk) --- revert spammish 'comment'</p>
<hr />
<div>__NOTOC__<br />
{{Greasemonkey Manual TOC}}<br />
<br />
This section of the manual will be short and sweet.<br />
As mentioned elsewhere, [[Greasemonkey]] provides several methods in its API to enhance the power of [[user script]]s.<br />
They are listed here, with a brief description, but each separate method has its own page with more in-depth information, please continue reading there!<br />
<br />
=== Headers ===<br />
; [[Metadata Block|Metadata Block]] : Through JavaScript comments, Greasemonkey has metadata, which gives information about the script and provides [[Metadata Block#.40resource|resources]] and functionality to scripts.<br />
<br />
=== Values ===<br />
; [[GM_deleteValue]] : This deletes a value from chrome that was previously set.<br />
; [[GM_getValue]] : A function intended to get stored values, see [[GM_setValue]] below.<br />
; [[GM_listValues]] : This API method retrieves an array of preference names that start with the branch's root.<br />
; [[GM_setValue]] : A function that accepts the name and value to store, persistently. This value can be retrieved later, even on a different invocation of the script, with [[GM_getValue]].<br />
<br />
=== Resources ===<br />
; [[GM_getResourceText]] : Like the previous, loads raw, plaintext from a resource.<br />
; [[GM_getResourceURL]] : A function that loads an external resource via a URL, such as an image, and returns the string containing the base64 encoded in the data: URL scheme.<br />
<br />
=== Common Task Helpers ===<br />
; [[GM_addStyle]] : A function, taking one parameter, a string of CSS to apply to the page.<br />
; [[GM_xmlhttpRequest]] : A version of the XMLHttpRequest method underlying AJAX, this API call does '''not''' use the same-origin policy that a script running in a normal page is limited with, allowing complex mashups.<br />
; [[unsafeWindow]] : This object provides access to the raw JavaScript <code>window</code> scope of the content page. It is most commonly used to access JavaScript variables on the page.<br />
<br />
=== Other ===<br />
; [[GM_log]] : A function that accepts a parameter which will be routed to the Error Console, useful for examining values when writing a script.<br />
; [[GM_openInTab]] : Similar in spirit to <code>window.open()</code>, this function accepts a single parameter, the URL of a page to open in a new tab.<br />
; [[GM_registerMenuCommand]] : An advanced function which allows a user script to register a menu item, and command to run when clicked, in the Firefox user interface.<br />
<br />
[[Category:API Reference|*{{FULLPAGENAME}}]]</div>Kwahhttps://wiki.greasespot.net/index.php?title=Include_and_exclude_rules&diff=6585Include and exclude rules2011-08-09T11:36:04Z<p>Kwah: /* Extra schemes */ Amend details to include information for about: urls since 0.9.8</p>
<hr />
<div>[[User script]]s specify include and exclude rules in the [[metadata block]].<br />
<br />
'''The script will execute if it matches any include rule, as long as it does not match an exclude rule.'''<br />
<br />
The rules are URLs, which can have a "wildcard" asterisk (*), which matches any string including the empty string. For example: <code><nowiki>http://www.example.com/foo/*</nowiki></code> will match:<br />
<br />
* <code><nowiki>http://www.example.com/foo/bar</nowiki></code> and,<br />
* <code><nowiki>http://www.example.com/foo/</nowiki></code><br />
<br />
but not:<br />
<br />
* <code><nowiki>http://www.example.com/baz/</nowiki></code>.<br />
<br />
== Globs ==<br />
<br />
Include and exclude rules support the <code>*</code> or [[wikipedia:Glob (programming)|globbing operator]].<br />
The <code>*</code> serves as a wildcard that matches one or more of any character.<br />
A rule can have several wildcards or none, in which case the rule must match the entire URL exactly.<br />
Exclude rules look the same, and prevent the script from being executed.<br />
For example:<br />
<br />
<pre class="sample"><br />
// ==UserScript==<br />
// @include <nowiki>http://www.example.com/foo/*</nowiki><br />
// @include <nowiki>http://www.example.org/*.bar</nowiki><br />
// @exclude <nowiki>http://www.example.com/foo/baz</nowiki><br />
// ==/UserScript==<br />
</pre><br />
<br />
If no include rule is provided, <code>@include *</code> is assumed.<br />
That is: every URL will be matched, within the allowed [[#Greaseable_schemes |Greaseable schemes]].<br />
<br />
== Regular Expressions ==<br />
<br />
As of [[Version_history#0.9.8|Greasemonkey 0.9.8]], support for full regular expressions in include and exclude rules was added.<br />
If the rule both starts and ends with a forward-slash (<code>/</code>) character, the contents inside those slashes are interpreted as a a regular expression.<br />
For example:<br />
<br />
<pre class="sample"><br />
// ==UserScript==<br />
// @include <nowiki>/^https?://www\.example\.com/.*$/</nowiki><br />
// @include <nowiki>/^http://www\.example\.(org|net)//</nowiki><br />
// ==/UserScript==<br />
</pre><br />
<br />
Note:<br />
* The rule is parsed as a standard javascript <code>new RegExp()</code>, so you do not need to escape forward slashes inside the rule. Other special characters (like <code>.</code> '''should''' still be escaped, as in the above examples.)<br />
* The rule is always treated as case insensitive.<br />
* Anchors (<code>^</code>, <code>$</code>) are not supplied for you. If desired, they should be used as in the above example.<br />
<br />
== Greaseable schemes ==<br />
<br />
Greasemonkey will run scripts only on documents loaded from particular [http://tools.ietf.org/html/rfc3986#section-3.1 schemes].<br />
By default, those are:<br />
<br />
* http<br />
* https<br />
* ftp<br />
* data<br />
<br />
(<b>Note:</b> What is officially called a 'scheme' in a URL is also found in Javascript as the <code>.protocol</code> property of any abstract <code>link</code> element such as <code>&lt;a&gt;</code>, <code>&lt;link&gt;</code>, or a DOM object such as <code>document.location</code>.)<br />
<br />
== Extra schemes ==<br />
<br />
Greasemonkey will also run scripts on:<br />
<br />
; file:<br />
: Only if <code>greasemonkey.fileIsGreaseable</code> is set to <code>true</code> in [http://kb.mozillazine.org/About:config about:config].<br />
; about:<br />
: <s>Prior to 0.9.8, scripts would only run if <code>greasemonkey.aboutIsGreaseable</code> is set to <code>true</code> in [http://kb.mozillazine.org/About:config about:config]. (But about:blank is always allowed.)</s>.<br />
: Since 0.9.8, Only about:blank is allowed. ({{GitTicket|1375}})<br />
<br />
In both cases this restriction is intended to prevent security/privacy vulnerabilities.<br />
<br />
== Magic TLD ==<br />
<br />
The only special syntax besides the wildcard is .tld. An include such as <code><nowiki>http://www.example.tld/*</nowiki></code> will match any top level domain, such as <code>www.example.com</code>, <code>www.example.org</code>, <code>www.example.co.uk</code>, and so on. One must be careful with this, to not accidentally leak data to a site that they did not mean to match. This list of TLDs includes a myriad of dual-segment TLDs (such as ca.us, aeroport.fr and kyoto.jp), beside the plain country or category codes (com, jp, se). For a full list see the [[Magic TLD]] page.<br />
<br />
== Data scheme user scripts ==<br />
<br />
Browsers can open windows in which all of the page top content is contained in a [http://en.wikipedia.org/wiki/Data_URI_scheme data scheme URI].<br />
For example, the below URI will display a HTML page that indirectly includes an image from google.com as its sole content:<br />
<br />
<nowiki>data:text/html;charset=utf-8,<html><head><title>data: test</title></head><body><img src='http://www.google.com/intl/en_ALL/images/logo.gif'></body></html></pre></nowiki><br />
<br />
[http://tinyurl.com/yl8djvy This link] points to the above data URI and can be clicked to see it in action.<br />
<br />
Firefox ignores unknown semicolon separated parameters in the header of a <code>data</code> URI (and the standards seem to leave this possibility open) which means if one adds say the string <code>MyScript;</code> in the header of the above URI, giving:<br />
<br />
data:text/html;MyScript;charset=utf-8,<html><head><title>data: test</title>....<br />
<br />
one can then use [[Include and exclude rules]] such as<br />
<br />
@include data:text/html;MyScript;*<br />
<br />
to trigger user scripts to run on a subtype of <code>data</code> URIs.<br />
<br />
This ability can be useful if a user script creates one or more <code>data</code> URIs and then opens them. Augmenting the URIs with some extra marking can cause specific user scripts to run in their windows. For example, a user script can create a <code>data URI</code> that contains a HTML <code>table</code> and trigger a user script for it that allows the user sort it.</div>Kwahhttps://wiki.greasespot.net/index.php?title=Version_history&diff=6584Version history2011-08-09T11:30:42Z<p>Kwah: Undo revision 6582 by 46.21.144.51 (talk) -- reverted spammy 'comment'</p>
<hr />
<div><div style="float:right; margin-left:1em;" class="hidenumbers">__TOC__</div><br />
<br />
== 0.9 ==<br />
<br />
=== 0.9.8 ===<br />
<br />
August 1, 2011<br />
[http://www.greasespot.net/2011/08/greasemonkey-098-release.html]<br />
<br />
Bug fixes:<br />
<br />
* User scripts cannot run in any about: pages besides about:blank. (Security enhancement; {{GitTicket|1375}})<br />
<br />
Enhancements:<br />
<br />
* Global, user specified, @exclude rules. ({{GitTicket|1002}})<br />
* Support for [[Metadata block#.40run-at|@run-at]] metadata imperative, which supports value document-start, as well as the standard document-end behavior. ({{GitTicket|1103}})<br />
* New [[Metadata block#.40match|@match]] metadata imperative, as implemented by Google Chrome. Thanks to [https://github.com/scriptish/scriptish/ Scriptish] for original implementation. ({{GitTicket|1377}})<br />
* Support for full regular expression syntax in [[Include and exclude rules]]. ({{GitTicket|1378}})<br />
<br />
=== 0.9.7 ===<br />
<br />
July 14, 2011<br />
[http://www.greasespot.net/2011/07/greasemonkey-097-release.html]<br />
<br />
Bug fixes:<br />
<br />
* Scripts with broken @icons will install, just with no icon. ({{GitTicket|1214}})<br />
* Editing the @icon line of a script will take effect immediately. ({{GitTicket|1215}})<br />
* Remote resources (@require, @resource, @icon) that redirect to other URLs will now work. ({{GitTicket|1222}})<br />
<br />
Enhancements:<br />
<br />
* Compatibility with Firefox 6 and 7. ({{GitTicket|1357}})<br />
* [[GM_openInTab]]() will respect the <code>insertRelatedAfterCurrent</code> preference. ({{GitTicket|1370}})<br />
<br />
=== 0.9.6 ===<br />
<br />
June 24, 2011<br />
[http://www.greasespot.net/2011/06/greasemonkey-096-release.html]<br />
<br />
Bug fixes:<br />
<br />
* [[GM_openInTab]]() fails in Firefox 3. ({{GitTicket|1361}})<br />
* Firefox 5: Error in Add-ons Manager. ({{GitTicket|1367}})<br />
<br />
Enhancements:<br />
<br />
* Add "get user scripts" link to the Add-ons Manager. ({{GitTicket|1213}})<br />
* Pass site cookies when downloading scripts. ({{GitTicket|1359}})<br />
<br />
=== 0.9.5 ===<br />
<br />
May 26, 2011<br />
[http://www.greasespot.net/2011/05/greasemonkey-095-release.html]<br />
<br />
Bug fixes:<br />
<br />
* Installing and uninstalling the same script many times does not work properly. ({{GitTicket|1353}})<br />
* GM_xmlhttpRequest() does not work in Firefox 5 betas. ({{GitTicket|1354}})<br />
* (Introduced in 0.9.4:) Cannot enable nor disable scripts. ({{GitTicket|1355}})<br />
* Installing the first user script while the user scripts pane of the add-ons manager is open leaves the "no user scripts" warning. ({{GitTicket|1356}})<br />
<br />
Enhancements:<br />
<br />
* The installation dialog shows the script version, if provided with @version. ({{GitTicket|1349}})<br />
<br />
=== 0.9.4 ===<br />
<br />
'''Note:''' Not publicly released due to bugs.<br />
<br />
May 24, 2011<br />
[http://www.greasespot.net/2011/05/greasemonkey-094-release.html]<br />
<br />
Bug fixes:<br />
<br />
* The GM_openInTab() API again returns a handle to the window object. ({{GitTicket|1298}})<br />
* Using alert() will not break setTimeout() nor GM_xmlhttpRequest(). ({{GitTicket|1318}})<br>'''Note:''' we currently only have a work-around in place, watch mozilla bug 647727 for a real fix.<br />
<br />
Enhancements:<br />
<br />
* When re-ordering execution of scripts: clicking the first/last item disables sooner/later items, and picking any of these will switch to Execution Order sort (if it is not already selected).<br />
* Removed the detail view for user scripts, which did not contain any more information than the list view.<br />
<br />
=== 0.9.3 ===<br />
<br />
April 28, 2011<br />
[http://www.greasespot.net/2011/04/greasemonkey-093-release.html]<br />
<br />
Bug fixes:<br />
<br />
* Error message logged ("Redeclaration of const document")/high CPU usage when closing the sidebar. ({{GitTicket|1226}}, {{GitTicket|1298}})<br />
* Navigating to a .user.js inside a frame works like anywhere else. ({{GitTicket|1248}})<br />
* The list of user scripts in the Add-ons Manager would sometimes forget its sort order. ({{GitTicket|1307}})<br />
* Compatibility enhancement with AutoPager (broken in 0.9.2). ({{GitTicket|1344}})<br />
* Passing a non-function to GM_registerMenuCommand()'s commandFunc broke the entire menu, and items showed up in the wrong order (both broken in 0.9.2). ({{GitTicket|1346}}, {{GitTicket|1347}})<br />
<br />
Enhancements:<br />
<br />
* Passing the Referer header works, for GM_xmlhttpRequest(). ({{GitTicket|1240}})<br />
* Accessibility: The sort buttons in the Add-ons Manager work with keyboard input (space/enter). ({{GitTicket|1345}})<br />
<br />
=== 0.9.2 ===<br />
<br />
April 5, 2011<br />
[http://www.greasespot.net/2011/03/greasemonkey-092-release.html]<br />
<br />
Bug Fixes:<br />
<br />
* Failure on OSX when Growl is installed, but not running. ({{GitTicket|1264}})<br />
* Incorrect display of Greasemonkey icon in Add-ons window (Firefox 3.6, OS X). ({{GitTicket|1284}}, {{GitTicket|1291}})<br />
* Provide a sort bar, to control display order of the scripts in the Add-ons manager, for Firefox 4. ({{GitTicket|1293}})<br />
* Remove "accelerator" keys from GM_registerMenuCommand(). ({{GitTicket|1312}}, [http://www.greasespot.net/2011/04/gmregistermenucommand-losing.html])<br />
* Work around incompatibility with Personas Plus extension. ({{GitTicket|1253}})<br />
<br />
Enhancements:<br />
<br />
* Provide a toolbar button, and remove the status bar icon for Firefox 4. ({{GitTicket|1227}})<br />
* When re-installing a script (e.g. for an update), keep it in the same execution order. ({{GitTicket|1267}})<br />
* Keep the add-ons manager view up to date when changing (installing/enabling/disabling/etc) user scripts. ({{GitTicket|1305}})<br />
<br />
=== 0.9.1 ===<br />
<br />
January 24, 2011<br />
[http://www.greasespot.net/2011/01/greasemonkey-091-release.html]<br />
<br />
Bug fixes:<br />
<br />
* Fix user script sandbox wrapping. This deals with lots of problems like <code>eval()</code>. ({{GitTicket|1258}}, also {{GitTicket|1254}}, {{GitTicket|1260}}, {{GitTicket|1263}}, {{GitTicket|1265}})<br />
* Fixed rare bug when installing scripts. ({{GitTicket|1250}})<br />
* Fixed errors when Growl is not installed on Mac OS X. ({{GitTicket|1249}})<br />
* Fixed problems with relative @require imperatives. ({{GitTicket|1262}})<br />
<br />
New features:<br />
<br />
* Allow sorting by descending (as well as ascending) execution order. ({{GitTicket|1217}})<br />
<br />
=== 0.9.0 ===<br />
<br />
January 18, 2011<br />
[http://www.greasespot.net/2010/11/greasemonkey-090-release.html]<br />
<br />
Features:<br />
<br />
* Compatibility with Firefox 4! Firefox 4 support is still preliminary. Everything probably works, but not everything works really well. The backlog of bugs for the next release is primarily focused on this.<br />
* Complete integration with the standard Firefox Add-ons dialog, treating User Scripts as just another kind of browser add-on. (See the reference link above for screenshots.)<br />
* A global options dialog, where the script editor can always be selected. ({{GitTicket|1012}}, {{GitTicket|1109}})<br />
* Live in-place editing for the entire script, including metadata (<code>@name</code>, <code>@require</code>, <code>@include</code>, <code>@exclude</code>, etc.). ({{GitTicket|1148}}, {{GitTicket|1157}}, {{GitTicket|1165}})<br />
* Web pages that end in .user.js are loaded as normal, instead of being installed as a user script. ({{GitTicket|1184}})<br />
<br />
Bug fixes / minor enhancements:<br />
<br />
* All Greasemonkey windows respond to standard close window keyboard shortcuts. ({{GitTicket|1085}})<br />
* Support for @icon metadata imperative, displayed in the new add-ons manager integration. ({{GitTicket|1096}})<br />
* Support user and password for <code>[[GM_xmlhttpRequest]]()</code>. ({{GitTicket|1100}})<br />
* Support @version metadata imperative. ({{GitTicket|1110}})<br />
* Suppress spurious <tt>Error: not well-formed (// ==UserScript==)</tt> error messages. ({{GitTicket|1134}})<br />
* The "install" menu item is removed. ({{GitTicket|1196}})<br />
<br />
== 0.8 ==<br />
<br />
=== 0.8.20100408.6 ===<br />
<br />
April 8, 2010<br />
[http://www.greasespot.net/2010/04/greasemonkey-086-release.html]<br />
<br />
Features:<br />
<br />
* Add a hidden preference to allow greasing the unmht: scheme. ({{GitTicket|1038}})<br />
* Allow relative URLs to be used for GM_xmlhttpRequest(), just like standard XMLHttpRequest. ({{GitTicket|1057}})<br />
* Performance enhancements and code improvements to internal logic behind @include and @exclude rules. ({{GitTicket|1070}} {{GitTicket|1074}} {{GitTicket|1089}})<br />
* Added translations: ca-ES, cs, fr, nl, sr-RS, vi.<br />
<br />
Bug fixes:<br />
<br />
* GM_xmlhttpRequest() can fail when Object.prototype has been modified. ({{GitTicket|1065}})<br />
* Two warnings upon making new script via "New User Script". ({{GitTicket|1069}})<br />
* Installing scripts from the hard drive (instead of via the web) can fail. ({{GitTicket|1077}})<br />
* Fix a flaw that could allow websites to prevent Greasemonkey from running. ({{GitTicket|1082}})<br />
* Error "this.menuCommanders is undefined" bug when closing a browser window. ({{GitTicket|1087}})<br />
* Error "ScriptDownloader is not defined" when performing view source on a user script. ({{GitTicket|1091}})<br />
<br />
=== 0.8.20100211.5 ===<br />
<br />
February 11, 2010<br />
[http://www.greasespot.net/2010/02/greasemonkey-085-release.html]<br />
<br />
* Add an abort() method for GM_xmlhttpRequest. ({{GitTicket|1007}})<br />
* Increase compatibility with bleeding-edge Firefox versions. ({{GitTicket|1054}})<br />
* Display a "welcome" page to new users when they install. ({{GitTicket|1006}})<br />
* Fix hooking into the console object for Firebug 1.5.<br />
<br />
=== 0.8.20091209.4 ===<br />
<br />
December 8, 2009<br />
[http://www.greasespot.net/2009/12/greasemonkey-084-released.html]<br />
<br />
* Properly specify the .finalUrl for [[GM_xmlhttpRequest]] results. ({{GitTicket|1063}})<br />
<br />
=== 0.8.20090920.2 ===<br />
<br />
September 26, 2009<br />
[http://www.greasespot.net/2009/09/greasemonkey-082-released.html]<br />
* Do not inject scripts into file: and about: URLs by default, for security reasons. ({{GitTicket|1000}})<br />
* The GM_openInTab() function respects the background loading tab behavior from Firefox preferences. ({{GitTicket|1003}})<br />
* Specify label/control associations in "New Script" dialog, for accessibility. ({{GitTicket|1010}})<br />
* Minor code clean ups and improvements. ({{GitTicket|1011}}, {{GitTicket|1020}})<br />
* Remove "forced" upgrade code. ({{GitTicket|1013}})<br />
* Remove extra spacing around the status bar icon. ({{GitTicket|1014}})<br />
* When adding include/exclude rules, include the port number in the default suggestion. ({{GitTicket|1015}})<br />
* Reduce noise logged to the console when interacting with Firebug. ({{GitTicket|1018}})<br />
* Apply security checks to GM_listValues() and GM_deleteValue(). ({{GitTicket|1019}})<br />
* Fix missing localized strings in various locales. ({{GitTicket|1022}})<br />
* Grease pages loaded into the sidebar. ({{GitTicket|1023}})<br />
* Allow user scripts to access the latest available JavaScript engine. ({{GitTicket|1026}})<br />
<br />
=== 0.8.20090123.1 ===<br />
<br />
February 18th, 2009<br />
[http://www.greasespot.net/2009/01/greasemonkey-release-08200901231.html]<br />
<br />
* Added translations: ar-SA, bn-IN, hu-HU, id-ID, ro-RO, sr-RS, vi-VN.<br />
* Fix for ticket #111 (anomalous separators in the monkey menu).<br />
* Added [[GM_deleteValue|GM_deleteValue]] and [[GM_listValues|GM_listValues]] APIs (#38).<br />
* Restore the anonymous function wrapper around scripts, and thus the same behavior as versions prior to 0.8 (by default, removable with the [[Metadata Block#.40unwrap|@unwrap]] metadata imperative, #108).<br />
* Improved interaction with the [[Useful_Tools_for_Script_Writers#FireBug|Firebug]] console (#122, #204).<br />
<br />
=== 0.8.20080609.0 ===<br />
<br />
June 12th, 2008<br />
[http://www.greasespot.net/2008/06/greasemonkey-version-08.html]<br />
<br />
* New metadata: [[Metadata Block#.40resource|@resource]], [[Metadata Block#.40resource|@require]].<br />
* New API functions: [[GM_getResourceURL]], [[GM_getResourceText]]<br />
* New property of [[GM_xmlhttpRequest]] return: [[GM_xmlhttpRequest#finalUrl|finalUrl]]<br />
* Internal code improvements<br />
* New graphics by Pak-Kei Mak, icons in the Add Ons dialog and Status Bar<br />
<br />
== 0.7 ==<br />
<br />
=== 0.7.20080121.0 ===<br />
<br />
Jan 21st, 2008<br />
[http://www.greasespot.net/2008/01/greasemonkey-security-update.html]<br />
<br />
* Security release where [[GM_xmlhttpRequest]], [[GM_getValue]] and [[GM_setValue]] were hardened against a privilege escalation attack targeting specific user scripts accessing anything through [[unsafeWindow]], thus gaining content code unrestricted access to those methods (thanks Anthony Lieuallen).<br/> This change breaks backwards compatibility for scripts granting page code direct or limited access to either method via function references on unsafeWindow; see [[0.7.20080121.0 compatibility]] for available workarounds.<br />
<br />
=== 0.7.0 ===<br />
<br />
May 24th, 2007<br />
[http://www.greasespot.net/2007/05/greasemonkey-07-candidate.html]<br />
<br />
* Fixed the bug where you can't install scripts if you have never disabled Greasemonkey.<br />
* Fixed the bug where drag and drop in the manage dialog only works once per view.<br />
* Fixed the bug where removing a script in the manage dialog also removes the last script.<br />
<br />
== 0.6 ==<br />
<br />
=== 0.6.9 ===<br />
<br />
May 9th, 2007<br />
[http://www.greasespot.net/2007/05/greasemonkey-069-gmscripts-directory.html]<br />
<br />
Introduced:<br />
* You can now reorder the scripts in the manage dialog with drag drop or the arrow keys.<br />
* You can now use [[Useful_Tools_for_Script_Writers#FireBug|Firebug]]'s console object to debug Greasemonkey if you have Firebug installed.<br />
* Fix bug where install dialog would pop up when Greasemonkey is disabled.<br />
* Make Greasemonkey enable/disable keyboard accessible. #9<br />
<br />
=== 0.6.8 ===<br />
<br />
March 17th, 2007<br />
[http://www.greasespot.net/2007/03/greasemonkey-068-new-script-ui-now.html]<br />
<br />
Introduced:<br />
<br />
* Rewrite of 'New Script...' UI. It now pops up a nice UI to get the script details and then generates and opens a script which is already installed that you can edit in one step. This is a huge improvement in the usability of this feature. Thanks to Anthony Lieuallen for the implementation.<br />
* Improvements to error reporting. Most types of errors in user scripts now give the correct line number in the error message. You can also click on the filename in [[Useful_Tools_for_Script_Writers#FireBug|Firebug]] to view the script, as with other types of errors in Firefox. Anthony is also responsible for this improvement.<br />
* Added support for [[GM_xmlhttpRequest#overrideMimeType|overrideMimeType]] to [[GM_xmlhttpRequest]]. Thanks to Lior Zur for the patch. To use, add overrideMimeType: "yourmimetypehere" to the object you pass to GM_xmlhttpRequest.<br />
* New translations for Finnish, Japanese, and Russian. The Greasemonkey UI looks particularly cool in Japanese. Thanks to Tommi Rautava, Hisateru Tanaka, and Александр Соколов for their contributions.<br />
<br />
=== 0.6.7 ===<br />
<br />
February 7th, 2007<br />
[http://www.greasespot.net/2007/02/greasemonkey-067-minor-ui-tweaks-new.html]<br />
<br />
Introduced:<br />
<br />
* Fixed the manage dialog so that it doesn't bounce around when you select different user scripts (thanks Anthony Lieuallen)<br />
* Added Basque translation (thanks 3ARRANO)<br />
* Updated German translation (thanks Matthias Bauer)<br />
* Middle-click on monkey icon now opens manage dialog, right-click on scripts in monkey menu opens them in an editor (thanks LouCypher and pile0nades)<br />
<br />
=== 0.6.6 ===<br />
<br />
October 16th, 2006<br />
[http://greaseblog.blogspot.com/2006/10/greasemonkey-066-firefox-2-support-and.html]<br />
<br />
Introduced:<br />
* Spiffy new installation dialog which more closely resembles the extension installation dialog, and presents more details in a user-friendly way.<br />
* Spanish language support.<br />
<br />
=== 0.6.5 ===<br />
<br />
July 28th, 2006<br />
[http://greasemonkey.mozdev.org/changes/0.6.5.20060727.html]<br />
<br />
Multiple versions released in separate places; largely to the Greasemonkey mailing list.<br />
Introduced:<br />
* Compatibility with Firefox 2.0.<br />
* Foreign language support for Czech, Dutch, and German.<br />
<br />
=== 0.6.4 ===<br />
<br />
November 30th, 2005<br />
[http://greaseblog.blogspot.com/2005/11/greasemonkey-064_30.html]<br />
[http://greasemonkey.mozdev.org/changes/0.6.4.html]<br />
<br />
Introduced:<br />
??<br />
<br />
=== 0.6.2 ===<br />
<br />
September 12th, 2005<br />
[http://greaseblog.blogspot.com/2005/09/firefox-15-compatible-greasemonkey.html]<br />
<br />
Introduced:<br />
* Compatibility with Firefox 1.5.<br />
* The [[Greasemonkey_Manual:Monkey_Menu|Monkey Menu]], a context menu for the status bar item added in 0.3 beta.<br />
* Simplified script installation dialogs.<br />
<br />
=== 0.6.1 ===<br />
September 9th-ish, 2005<br />
<br />
"The Lost Version"<br />
<br />
Prerelease showing of:<br />
* [[GM_addStyle|GM_addStyle]] (From release 0.6.1.4... I probably have this archived somewhere LOL)<br />
* The [[Greasemonkey_Manual:Monkey_Menu|Monkey Menu]], a context menu for the status bar item added in 0.3 beta.<br />
* Simplified script installation dialogs.<br />
<br />
Some sort of mad scramble occurred on this week when Firefox 1.5b1 was released and this version was lost but not forgotten.<br />
<br />
== 0.5 ==<br />
<br />
=== 0.5.3 ===<br />
<br />
September 3rd, 2005<br />
[http://greaseblog.blogspot.com/2005/09/053-available.html]<br />
[http://greasemonkey.mozdev.org/changes/0.5.3.html]<br />
<br />
=== 0.5.2 ===<br />
<br />
September 1st, 2005<br />
[http://greaseblog.blogspot.com/2005/09/035-051-migration-madness.html]<br />
<br />
Released to the Greasemonkey mailing list, fixed bugs in the automatic migration system for the changes between the 0.3 and 0.5 branches.<br />
<br />
=== 0.5.1 ===<br />
<br />
August 25, 2005<br />
[http://greaseblog.blogspot.com/2005/08/greasemonkey-051-final.html]<br />
[http://greasemonkey.mozdev.org/changes/0.5.1.html]<br />
<br />
Introduced:<br />
* Security fix wherein a [[user script]] could elevate itself to chrome privileges.<br />
* User can select the editor to use for "Edit" in manage, and "New User Script".<br />
* Unicode support for non-english characters.<br />
<br />
=== 0.5 beta ===<br />
<br />
July 30th, 2005<br />
[http://greaseblog.blogspot.com/2005/07/greasemonkey-05-beta.html]<br />
[http://greasemonkey.mozdev.org/changes/0.5.html]<br />
<br />
The first release containing [[security]] fixes over 0.3.5 intended for public consumption.<br />
"Greasemonkey 0.5 is actually the combination of a massive security audit and all the new code which was planned for 0.4."<br />
<br />
Introduced:<br />
* [[GM_openInTab]], [[unsafeWindow]]<br />
* Enhancements to [[GM_registerMenuCommand]]: keyboard shortcuts, stability.<br />
* Memory leak fixes.<br />
* "New User Script" menu item, shortcut to a new blank template for [[user script]] authors.<br />
* Restricted [[GM_xmlhttpRequest]] from accessing local <code>file://</code> URLs.<br />
<br />
== 0.4 ==<br />
<br />
=== 0.4.x ===<br />
<br />
''Details needed.''<br />
<br />
The 0.4 branch was an internal development version, where experimentation for security fixes happened.<br />
<br />
== 0.3 ==<br />
<br />
<br />
=== 0.3.5 ===<br />
<br />
July 19th, 2005<br />
[http://greaseblog.blogspot.com/2005/07/mandatory-greasemonkey-update.html]<br />
[http://greasemonkey.mozdev.org/changes/0.3.5.html]<br />
<br />
[[Security]] flaw release.<br />
Contained no fixes, rather removed all vulnerable features.<br />
Intended for (limited) continued use while fixes were being performed.<br />
<br />
=== 0.3.4 ===<br />
<br />
May 12th, 2005<br />
[http://greasemonkey.mozdev.org/changes/0.3.4.html]<br />
<br />
Introduced:<br />
* ".tld" support in @include/@exclude, allowing things like <code>@include <nowiki>http://www.example.tld/</nowiki></code> for all international permutations.<br />
* Log level option for [[GM_log]]<br />
* Minor enhancements and bugfixes.<br />
<br />
=== 0.3.3 ===<br />
<br />
May 10th, 2005<br />
[http://greaseblog.blogspot.com/2005/05/greasemonkey-033-beta.html]<br />
[http://greasemonkey.mozdev.org/changes/0.3.3.html]<br />
<br />
Primarily bugfix release.<br />
<br />
=== 0.3 beta ===<br />
<br />
April 23rd, 2005<br />
[http://greaseblog.blogspot.com/2005/04/greasemonkey-03b-beta.html]<br />
[http://greasemonkey.mozdev.org/changes/0.3b.html]<br />
<br />
Introduced:<br />
* Edit button in the manage dialog.<br />
* Monkey icon in the status bar, click to enable/disable.<br />
* [[GM_getValue]], [[GM_setValue]], [[GM_log]]<br />
<br />
== 0.2 ==<br />
<br />
=== 0.2.6 ===<br />
<br />
March 30th, 2005<br />
[http://greaseblog.blogspot.com/2005/03/greasemonkey-026-now-with-less-fatal.html]<br />
[http://greasemonkey.mozdev.org/changes/0.2.6.html]<br />
<br />
Bugfix release.<br />
<br />
=== 0.2.5 ===<br />
<br />
March 28th, 2005<br />
[http://greaseblog.blogspot.com/2005/03/greasemonkey-025-xmlhttp-across.html]<br />
[http://greasemonkey.mozdev.org/changes/0.2.5.html]<br />
<br />
Introduced:<br />
* [[GM_xmlhttpRequest]]<br />
* [[GM_registerMenuCommand]]<br />
<br />
Also, the default user scripts that were bundled with [[Greasemonkey]] by default until this point were removed.</div>Kwahhttps://wiki.greasespot.net/index.php?title=Version_history&diff=6581Version history2011-08-09T11:16:18Z<p>Kwah: /* 0.9.8 */ Mixed up description of @match and @run-at</p>
<hr />
<div><div style="float:right; margin-left:1em;" class="hidenumbers">__TOC__</div><br />
<br />
== 0.9 ==<br />
<br />
=== 0.9.8 ===<br />
<br />
August 1, 2011<br />
[http://www.greasespot.net/2011/08/greasemonkey-098-release.html]<br />
<br />
Bug fixes:<br />
<br />
* User scripts cannot run in any about: pages besides about:blank. (Security enhancement; {{GitTicket|1375}})<br />
<br />
Enhancements:<br />
<br />
* Global, user specified, @exclude rules. ({{GitTicket|1002}})<br />
* Support for [[Metadata block#.40run-at|@run-at]] metadata imperative, which supports value document-start, as well as the standard document-end behavior. ({{GitTicket|1103}})<br />
* New [[Metadata block#.40match|@match]] metadata imperative, as implemented by Google Chrome. Thanks to [https://github.com/scriptish/scriptish/ Scriptish] for original implementation. ({{GitTicket|1377}})<br />
* Support for full regular expression syntax in [[Include and exclude rules]]. ({{GitTicket|1378}})<br />
<br />
=== 0.9.7 ===<br />
<br />
July 14, 2011<br />
[http://www.greasespot.net/2011/07/greasemonkey-097-release.html]<br />
<br />
Bug fixes:<br />
<br />
* Scripts with broken @icons will install, just with no icon. ({{GitTicket|1214}})<br />
* Editing the @icon line of a script will take effect immediately. ({{GitTicket|1215}})<br />
* Remote resources (@require, @resource, @icon) that redirect to other URLs will now work. ({{GitTicket|1222}})<br />
<br />
Enhancements:<br />
<br />
* Compatibility with Firefox 6 and 7. ({{GitTicket|1357}})<br />
* [[GM_openInTab]]() will respect the <code>insertRelatedAfterCurrent</code> preference. ({{GitTicket|1370}})<br />
<br />
=== 0.9.6 ===<br />
<br />
June 24, 2011<br />
[http://www.greasespot.net/2011/06/greasemonkey-096-release.html]<br />
<br />
Bug fixes:<br />
<br />
* [[GM_openInTab]]() fails in Firefox 3. ({{GitTicket|1361}})<br />
* Firefox 5: Error in Add-ons Manager. ({{GitTicket|1367}})<br />
<br />
Enhancements:<br />
<br />
* Add "get user scripts" link to the Add-ons Manager. ({{GitTicket|1213}})<br />
* Pass site cookies when downloading scripts. ({{GitTicket|1359}})<br />
<br />
=== 0.9.5 ===<br />
<br />
May 26, 2011<br />
[http://www.greasespot.net/2011/05/greasemonkey-095-release.html]<br />
<br />
Bug fixes:<br />
<br />
* Installing and uninstalling the same script many times does not work properly. ({{GitTicket|1353}})<br />
* GM_xmlhttpRequest() does not work in Firefox 5 betas. ({{GitTicket|1354}})<br />
* (Introduced in 0.9.4:) Cannot enable nor disable scripts. ({{GitTicket|1355}})<br />
* Installing the first user script while the user scripts pane of the add-ons manager is open leaves the "no user scripts" warning. ({{GitTicket|1356}})<br />
<br />
Enhancements:<br />
<br />
* The installation dialog shows the script version, if provided with @version. ({{GitTicket|1349}})<br />
<br />
=== 0.9.4 ===<br />
<br />
'''Note:''' Not publicly released due to bugs.<br />
<br />
May 24, 2011<br />
[http://www.greasespot.net/2011/05/greasemonkey-094-release.html]<br />
<br />
Bug fixes:<br />
<br />
* The GM_openInTab() API again returns a handle to the window object. ({{GitTicket|1298}})<br />
* Using alert() will not break setTimeout() nor GM_xmlhttpRequest(). ({{GitTicket|1318}})<br>'''Note:''' we currently only have a work-around in place, watch mozilla bug 647727 for a real fix.<br />
<br />
Enhancements:<br />
<br />
* When re-ordering execution of scripts: clicking the first/last item disables sooner/later items, and picking any of these will switch to Execution Order sort (if it is not already selected).<br />
* Removed the detail view for user scripts, which did not contain any more information than the list view.<br />
<br />
=== 0.9.3 ===<br />
<br />
April 28, 2011<br />
[http://www.greasespot.net/2011/04/greasemonkey-093-release.html]<br />
<br />
Bug fixes:<br />
<br />
* Error message logged ("Redeclaration of const document")/high CPU usage when closing the sidebar. ({{GitTicket|1226}}, {{GitTicket|1298}})<br />
* Navigating to a .user.js inside a frame works like anywhere else. ({{GitTicket|1248}})<br />
* The list of user scripts in the Add-ons Manager would sometimes forget its sort order. ({{GitTicket|1307}})<br />
* Compatibility enhancement with AutoPager (broken in 0.9.2). ({{GitTicket|1344}})<br />
* Passing a non-function to GM_registerMenuCommand()'s commandFunc broke the entire menu, and items showed up in the wrong order (both broken in 0.9.2). ({{GitTicket|1346}}, {{GitTicket|1347}})<br />
<br />
Enhancements:<br />
<br />
* Passing the Referer header works, for GM_xmlhttpRequest(). ({{GitTicket|1240}})<br />
* Accessibility: The sort buttons in the Add-ons Manager work with keyboard input (space/enter). ({{GitTicket|1345}})<br />
<br />
=== 0.9.2 ===<br />
<br />
April 5, 2011<br />
[http://www.greasespot.net/2011/03/greasemonkey-092-release.html]<br />
<br />
Bug Fixes:<br />
<br />
* Failure on OSX when Growl is installed, but not running. ({{GitTicket|1264}})<br />
* Incorrect display of Greasemonkey icon in Add-ons window (Firefox 3.6, OS X). ({{GitTicket|1284}}, {{GitTicket|1291}})<br />
* Provide a sort bar, to control display order of the scripts in the Add-ons manager, for Firefox 4. ({{GitTicket|1293}})<br />
* Remove "accelerator" keys from GM_registerMenuCommand(). ({{GitTicket|1312}}, [http://www.greasespot.net/2011/04/gmregistermenucommand-losing.html])<br />
* Work around incompatibility with Personas Plus extension. ({{GitTicket|1253}})<br />
<br />
Enhancements:<br />
<br />
* Provide a toolbar button, and remove the status bar icon for Firefox 4. ({{GitTicket|1227}})<br />
* When re-installing a script (e.g. for an update), keep it in the same execution order. ({{GitTicket|1267}})<br />
* Keep the add-ons manager view up to date when changing (installing/enabling/disabling/etc) user scripts. ({{GitTicket|1305}})<br />
<br />
=== 0.9.1 ===<br />
<br />
January 24, 2011<br />
[http://www.greasespot.net/2011/01/greasemonkey-091-release.html]<br />
<br />
Bug fixes:<br />
<br />
* Fix user script sandbox wrapping. This deals with lots of problems like <code>eval()</code>. ({{GitTicket|1258}}, also {{GitTicket|1254}}, {{GitTicket|1260}}, {{GitTicket|1263}}, {{GitTicket|1265}})<br />
* Fixed rare bug when installing scripts. ({{GitTicket|1250}})<br />
* Fixed errors when Growl is not installed on Mac OS X. ({{GitTicket|1249}})<br />
* Fixed problems with relative @require imperatives. ({{GitTicket|1262}})<br />
<br />
New features:<br />
<br />
* Allow sorting by descending (as well as ascending) execution order. ({{GitTicket|1217}})<br />
<br />
=== 0.9.0 ===<br />
<br />
January 18, 2011<br />
[http://www.greasespot.net/2010/11/greasemonkey-090-release.html]<br />
<br />
Features:<br />
<br />
* Compatibility with Firefox 4! Firefox 4 support is still preliminary. Everything probably works, but not everything works really well. The backlog of bugs for the next release is primarily focused on this.<br />
* Complete integration with the standard Firefox Add-ons dialog, treating User Scripts as just another kind of browser add-on. (See the reference link above for screenshots.)<br />
* A global options dialog, where the script editor can always be selected. ({{GitTicket|1012}}, {{GitTicket|1109}})<br />
* Live in-place editing for the entire script, including metadata (<code>@name</code>, <code>@require</code>, <code>@include</code>, <code>@exclude</code>, etc.). ({{GitTicket|1148}}, {{GitTicket|1157}}, {{GitTicket|1165}})<br />
* Web pages that end in .user.js are loaded as normal, instead of being installed as a user script. ({{GitTicket|1184}})<br />
<br />
Bug fixes / minor enhancements:<br />
<br />
* All Greasemonkey windows respond to standard close window keyboard shortcuts. ({{GitTicket|1085}})<br />
* Support for @icon metadata imperative, displayed in the new add-ons manager integration. ({{GitTicket|1096}})<br />
* Support user and password for <code>[[GM_xmlhttpRequest]]()</code>. ({{GitTicket|1100}})<br />
* Support @version metadata imperative. ({{GitTicket|1110}})<br />
* Suppress spurious <tt>Error: not well-formed (// ==UserScript==)</tt> error messages. ({{GitTicket|1134}})<br />
* The "install" menu item is removed. ({{GitTicket|1196}})<br />
<br />
== 0.8 ==<br />
<br />
=== 0.8.20100408.6 ===<br />
<br />
April 8, 2010<br />
[http://www.greasespot.net/2010/04/greasemonkey-086-release.html]<br />
<br />
Features:<br />
<br />
* Add a hidden preference to allow greasing the unmht: scheme. ({{GitTicket|1038}})<br />
* Allow relative URLs to be used for GM_xmlhttpRequest(), just like standard XMLHttpRequest. ({{GitTicket|1057}})<br />
* Performance enhancements and code improvements to internal logic behind @include and @exclude rules. ({{GitTicket|1070}} {{GitTicket|1074}} {{GitTicket|1089}})<br />
* Added translations: ca-ES, cs, fr, nl, sr-RS, vi.<br />
<br />
Bug fixes:<br />
<br />
* GM_xmlhttpRequest() can fail when Object.prototype has been modified. ({{GitTicket|1065}})<br />
* Two warnings upon making new script via "New User Script". ({{GitTicket|1069}})<br />
* Installing scripts from the hard drive (instead of via the web) can fail. ({{GitTicket|1077}})<br />
* Fix a flaw that could allow websites to prevent Greasemonkey from running. ({{GitTicket|1082}})<br />
* Error "this.menuCommanders is undefined" bug when closing a browser window. ({{GitTicket|1087}})<br />
* Error "ScriptDownloader is not defined" when performing view source on a user script. ({{GitTicket|1091}})<br />
<br />
=== 0.8.20100211.5 ===<br />
<br />
February 11, 2010<br />
[http://www.greasespot.net/2010/02/greasemonkey-085-release.html]<br />
<br />
* Add an abort() method for GM_xmlhttpRequest. ({{GitTicket|1007}})<br />
* Increase compatibility with bleeding-edge Firefox versions. ({{GitTicket|1054}})<br />
* Display a "welcome" page to new users when they install. ({{GitTicket|1006}})<br />
* Fix hooking into the console object for Firebug 1.5.<br />
<br />
=== 0.8.20091209.4 ===<br />
<br />
December 8, 2009<br />
[http://www.greasespot.net/2009/12/greasemonkey-084-released.html]<br />
<br />
* Properly specify the .finalUrl for [[GM_xmlhttpRequest]] results. ({{GitTicket|1063}})<br />
<br />
=== 0.8.20090920.2 ===<br />
<br />
September 26, 2009<br />
[http://www.greasespot.net/2009/09/greasemonkey-082-released.html]<br />
* Do not inject scripts into file: and about: URLs by default, for security reasons. ({{GitTicket|1000}})<br />
* The GM_openInTab() function respects the background loading tab behavior from Firefox preferences. ({{GitTicket|1003}})<br />
* Specify label/control associations in "New Script" dialog, for accessibility. ({{GitTicket|1010}})<br />
* Minor code clean ups and improvements. ({{GitTicket|1011}}, {{GitTicket|1020}})<br />
* Remove "forced" upgrade code. ({{GitTicket|1013}})<br />
* Remove extra spacing around the status bar icon. ({{GitTicket|1014}})<br />
* When adding include/exclude rules, include the port number in the default suggestion. ({{GitTicket|1015}})<br />
* Reduce noise logged to the console when interacting with Firebug. ({{GitTicket|1018}})<br />
* Apply security checks to GM_listValues() and GM_deleteValue(). ({{GitTicket|1019}})<br />
* Fix missing localized strings in various locales. ({{GitTicket|1022}})<br />
* Grease pages loaded into the sidebar. ({{GitTicket|1023}})<br />
* Allow user scripts to access the latest available JavaScript engine. ({{GitTicket|1026}})<br />
<br />
=== 0.8.20090123.1 ===<br />
<br />
February 18th, 2009<br />
[http://www.greasespot.net/2009/01/greasemonkey-release-08200901231.html]<br />
<br />
* Added translations: ar-SA, bn-IN, hu-HU, id-ID, ro-RO, sr-RS, vi-VN.<br />
* Fix for ticket #111 (anomalous separators in the monkey menu).<br />
* Added [[GM_deleteValue|GM_deleteValue]] and [[GM_listValues|GM_listValues]] APIs (#38).<br />
* Restore the anonymous function wrapper around scripts, and thus the same behavior as versions prior to 0.8 (by default, removable with the [[Metadata Block#.40unwrap|@unwrap]] metadata imperative, #108).<br />
* Improved interaction with the [[Useful_Tools_for_Script_Writers#FireBug|Firebug]] console (#122, #204).<br />
<br />
=== 0.8.20080609.0 ===<br />
<br />
June 12th, 2008<br />
[http://www.greasespot.net/2008/06/greasemonkey-version-08.html]<br />
<br />
* New metadata: [[Metadata Block#.40resource|@resource]], [[Metadata Block#.40resource|@require]].<br />
* New API functions: [[GM_getResourceURL]], [[GM_getResourceText]]<br />
* New property of [[GM_xmlhttpRequest]] return: [[GM_xmlhttpRequest#finalUrl|finalUrl]]<br />
* Internal code improvements<br />
* New graphics by Pak-Kei Mak, icons in the Add Ons dialog and Status Bar<br />
<br />
== 0.7 ==<br />
<br />
=== 0.7.20080121.0 ===<br />
<br />
Jan 21st, 2008<br />
[http://www.greasespot.net/2008/01/greasemonkey-security-update.html]<br />
<br />
* Security release where [[GM_xmlhttpRequest]], [[GM_getValue]] and [[GM_setValue]] were hardened against a privilege escalation attack targeting specific user scripts accessing anything through [[unsafeWindow]], thus gaining content code unrestricted access to those methods (thanks Anthony Lieuallen).<br/> This change breaks backwards compatibility for scripts granting page code direct or limited access to either method via function references on unsafeWindow; see [[0.7.20080121.0 compatibility]] for available workarounds.<br />
<br />
=== 0.7.0 ===<br />
<br />
May 24th, 2007<br />
[http://www.greasespot.net/2007/05/greasemonkey-07-candidate.html]<br />
<br />
* Fixed the bug where you can't install scripts if you have never disabled Greasemonkey.<br />
* Fixed the bug where drag and drop in the manage dialog only works once per view.<br />
* Fixed the bug where removing a script in the manage dialog also removes the last script.<br />
<br />
== 0.6 ==<br />
<br />
=== 0.6.9 ===<br />
<br />
May 9th, 2007<br />
[http://www.greasespot.net/2007/05/greasemonkey-069-gmscripts-directory.html]<br />
<br />
Introduced:<br />
* You can now reorder the scripts in the manage dialog with drag drop or the arrow keys.<br />
* You can now use [[Useful_Tools_for_Script_Writers#FireBug|Firebug]]'s console object to debug Greasemonkey if you have Firebug installed.<br />
* Fix bug where install dialog would pop up when Greasemonkey is disabled.<br />
* Make Greasemonkey enable/disable keyboard accessible. #9<br />
<br />
=== 0.6.8 ===<br />
<br />
March 17th, 2007<br />
[http://www.greasespot.net/2007/03/greasemonkey-068-new-script-ui-now.html]<br />
<br />
Introduced:<br />
<br />
* Rewrite of 'New Script...' UI. It now pops up a nice UI to get the script details and then generates and opens a script which is already installed that you can edit in one step. This is a huge improvement in the usability of this feature. Thanks to Anthony Lieuallen for the implementation.<br />
* Improvements to error reporting. Most types of errors in user scripts now give the correct line number in the error message. You can also click on the filename in [[Useful_Tools_for_Script_Writers#FireBug|Firebug]] to view the script, as with other types of errors in Firefox. Anthony is also responsible for this improvement.<br />
* Added support for [[GM_xmlhttpRequest#overrideMimeType|overrideMimeType]] to [[GM_xmlhttpRequest]]. Thanks to Lior Zur for the patch. To use, add overrideMimeType: "yourmimetypehere" to the object you pass to GM_xmlhttpRequest.<br />
* New translations for Finnish, Japanese, and Russian. The Greasemonkey UI looks particularly cool in Japanese. Thanks to Tommi Rautava, Hisateru Tanaka, and Александр Соколов for their contributions.<br />
<br />
=== 0.6.7 ===<br />
<br />
February 7th, 2007<br />
[http://www.greasespot.net/2007/02/greasemonkey-067-minor-ui-tweaks-new.html]<br />
<br />
Introduced:<br />
<br />
* Fixed the manage dialog so that it doesn't bounce around when you select different user scripts (thanks Anthony Lieuallen)<br />
* Added Basque translation (thanks 3ARRANO)<br />
* Updated German translation (thanks Matthias Bauer)<br />
* Middle-click on monkey icon now opens manage dialog, right-click on scripts in monkey menu opens them in an editor (thanks LouCypher and pile0nades)<br />
<br />
=== 0.6.6 ===<br />
<br />
October 16th, 2006<br />
[http://greaseblog.blogspot.com/2006/10/greasemonkey-066-firefox-2-support-and.html]<br />
<br />
Introduced:<br />
* Spiffy new installation dialog which more closely resembles the extension installation dialog, and presents more details in a user-friendly way.<br />
* Spanish language support.<br />
<br />
=== 0.6.5 ===<br />
<br />
July 28th, 2006<br />
[http://greasemonkey.mozdev.org/changes/0.6.5.20060727.html]<br />
<br />
Multiple versions released in separate places; largely to the Greasemonkey mailing list.<br />
Introduced:<br />
* Compatibility with Firefox 2.0.<br />
* Foreign language support for Czech, Dutch, and German.<br />
<br />
=== 0.6.4 ===<br />
<br />
November 30th, 2005<br />
[http://greaseblog.blogspot.com/2005/11/greasemonkey-064_30.html]<br />
[http://greasemonkey.mozdev.org/changes/0.6.4.html]<br />
<br />
Introduced:<br />
??<br />
<br />
=== 0.6.2 ===<br />
<br />
September 12th, 2005<br />
[http://greaseblog.blogspot.com/2005/09/firefox-15-compatible-greasemonkey.html]<br />
<br />
Introduced:<br />
* Compatibility with Firefox 1.5.<br />
* The [[Greasemonkey_Manual:Monkey_Menu|Monkey Menu]], a context menu for the status bar item added in 0.3 beta.<br />
* Simplified script installation dialogs.<br />
<br />
=== 0.6.1 ===<br />
September 9th-ish, 2005<br />
<br />
"The Lost Version"<br />
<br />
Prerelease showing of:<br />
* [[GM_addStyle|GM_addStyle]] (From release 0.6.1.4... I probably have this archived somewhere LOL)<br />
* The [[Greasemonkey_Manual:Monkey_Menu|Monkey Menu]], a context menu for the status bar item added in 0.3 beta.<br />
* Simplified script installation dialogs.<br />
<br />
Some sort of mad scramble occurred on this week when Firefox 1.5b1 was released and this version was lost but not forgotten.<br />
<br />
== 0.5 ==<br />
<br />
=== 0.5.3 ===<br />
<br />
September 3rd, 2005<br />
[http://greaseblog.blogspot.com/2005/09/053-available.html]<br />
[http://greasemonkey.mozdev.org/changes/0.5.3.html]<br />
<br />
=== 0.5.2 ===<br />
<br />
September 1st, 2005<br />
[http://greaseblog.blogspot.com/2005/09/035-051-migration-madness.html]<br />
<br />
Released to the Greasemonkey mailing list, fixed bugs in the automatic migration system for the changes between the 0.3 and 0.5 branches.<br />
<br />
=== 0.5.1 ===<br />
<br />
August 25, 2005<br />
[http://greaseblog.blogspot.com/2005/08/greasemonkey-051-final.html]<br />
[http://greasemonkey.mozdev.org/changes/0.5.1.html]<br />
<br />
Introduced:<br />
* Security fix wherein a [[user script]] could elevate itself to chrome privileges.<br />
* User can select the editor to use for "Edit" in manage, and "New User Script".<br />
* Unicode support for non-english characters.<br />
<br />
=== 0.5 beta ===<br />
<br />
July 30th, 2005<br />
[http://greaseblog.blogspot.com/2005/07/greasemonkey-05-beta.html]<br />
[http://greasemonkey.mozdev.org/changes/0.5.html]<br />
<br />
The first release containing [[security]] fixes over 0.3.5 intended for public consumption.<br />
"Greasemonkey 0.5 is actually the combination of a massive security audit and all the new code which was planned for 0.4."<br />
<br />
Introduced:<br />
* [[GM_openInTab]], [[unsafeWindow]]<br />
* Enhancements to [[GM_registerMenuCommand]]: keyboard shortcuts, stability.<br />
* Memory leak fixes.<br />
* "New User Script" menu item, shortcut to a new blank template for [[user script]] authors.<br />
* Restricted [[GM_xmlhttpRequest]] from accessing local <code>file://</code> URLs.<br />
<br />
== 0.4 ==<br />
<br />
=== 0.4.x ===<br />
<br />
''Details needed.''<br />
<br />
The 0.4 branch was an internal development version, where experimentation for security fixes happened.<br />
<br />
== 0.3 ==<br />
<br />
<br />
=== 0.3.5 ===<br />
<br />
July 19th, 2005<br />
[http://greaseblog.blogspot.com/2005/07/mandatory-greasemonkey-update.html]<br />
[http://greasemonkey.mozdev.org/changes/0.3.5.html]<br />
<br />
[[Security]] flaw release.<br />
Contained no fixes, rather removed all vulnerable features.<br />
Intended for (limited) continued use while fixes were being performed.<br />
<br />
=== 0.3.4 ===<br />
<br />
May 12th, 2005<br />
[http://greasemonkey.mozdev.org/changes/0.3.4.html]<br />
<br />
Introduced:<br />
* ".tld" support in @include/@exclude, allowing things like <code>@include <nowiki>http://www.example.tld/</nowiki></code> for all international permutations.<br />
* Log level option for [[GM_log]]<br />
* Minor enhancements and bugfixes.<br />
<br />
=== 0.3.3 ===<br />
<br />
May 10th, 2005<br />
[http://greaseblog.blogspot.com/2005/05/greasemonkey-033-beta.html]<br />
[http://greasemonkey.mozdev.org/changes/0.3.3.html]<br />
<br />
Primarily bugfix release.<br />
<br />
=== 0.3 beta ===<br />
<br />
April 23rd, 2005<br />
[http://greaseblog.blogspot.com/2005/04/greasemonkey-03b-beta.html]<br />
[http://greasemonkey.mozdev.org/changes/0.3b.html]<br />
<br />
Introduced:<br />
* Edit button in the manage dialog.<br />
* Monkey icon in the status bar, click to enable/disable.<br />
* [[GM_getValue]], [[GM_setValue]], [[GM_log]]<br />
<br />
== 0.2 ==<br />
<br />
=== 0.2.6 ===<br />
<br />
March 30th, 2005<br />
[http://greaseblog.blogspot.com/2005/03/greasemonkey-026-now-with-less-fatal.html]<br />
[http://greasemonkey.mozdev.org/changes/0.2.6.html]<br />
<br />
Bugfix release.<br />
<br />
=== 0.2.5 ===<br />
<br />
March 28th, 2005<br />
[http://greaseblog.blogspot.com/2005/03/greasemonkey-025-xmlhttp-across.html]<br />
[http://greasemonkey.mozdev.org/changes/0.2.5.html]<br />
<br />
Introduced:<br />
* [[GM_xmlhttpRequest]]<br />
* [[GM_registerMenuCommand]]<br />
<br />
Also, the default user scripts that were bundled with [[Greasemonkey]] by default until this point were removed.</div>Kwahhttps://wiki.greasespot.net/index.php?title=Version_history&diff=6580Version history2011-08-09T11:10:44Z<p>Kwah: /* 0.9.7 */ missing } brace</p>
<hr />
<div><div style="float:right; margin-left:1em;" class="hidenumbers">__TOC__</div><br />
<br />
== 0.9 ==<br />
<br />
=== 0.9.8 ===<br />
<br />
August 1, 2011<br />
[http://www.greasespot.net/2011/08/greasemonkey-098-release.html]<br />
<br />
Bug fixes:<br />
<br />
* User scripts cannot run in any about: pages besides about:blank. (Security enhancement; {{GitTicket|1375}})<br />
<br />
Enhancements:<br />
<br />
* Global, user specified, @exclude rules. ({{GitTicket|1002}})<br />
* New [[Metadata block#.40match|@match]] metadata imperative, which supports value document-start, as well as the standard document-end behavior. ({{GitTicket|1103}})<br />
* Support for [[Metadata block#.40run-at|@run-at]] metadata imperative, as implemented by Google Chrome. Thanks to [https://github.com/scriptish/scriptish/ Scriptish] for original implementation. ({{GitTicket|1377}})<br />
* Support for full regular expression syntax in [[Include and exclude rules]]. ({{GitTicket|1378}})<br />
<br />
=== 0.9.7 ===<br />
<br />
July 14, 2011<br />
[http://www.greasespot.net/2011/07/greasemonkey-097-release.html]<br />
<br />
Bug fixes:<br />
<br />
* Scripts with broken @icons will install, just with no icon. ({{GitTicket|1214}})<br />
* Editing the @icon line of a script will take effect immediately. ({{GitTicket|1215}})<br />
* Remote resources (@require, @resource, @icon) that redirect to other URLs will now work. ({{GitTicket|1222}})<br />
<br />
Enhancements:<br />
<br />
* Compatibility with Firefox 6 and 7. ({{GitTicket|1357}})<br />
* [[GM_openInTab]]() will respect the <code>insertRelatedAfterCurrent</code> preference. ({{GitTicket|1370}})<br />
<br />
=== 0.9.6 ===<br />
<br />
June 24, 2011<br />
[http://www.greasespot.net/2011/06/greasemonkey-096-release.html]<br />
<br />
Bug fixes:<br />
<br />
* [[GM_openInTab]]() fails in Firefox 3. ({{GitTicket|1361}})<br />
* Firefox 5: Error in Add-ons Manager. ({{GitTicket|1367}})<br />
<br />
Enhancements:<br />
<br />
* Add "get user scripts" link to the Add-ons Manager. ({{GitTicket|1213}})<br />
* Pass site cookies when downloading scripts. ({{GitTicket|1359}})<br />
<br />
=== 0.9.5 ===<br />
<br />
May 26, 2011<br />
[http://www.greasespot.net/2011/05/greasemonkey-095-release.html]<br />
<br />
Bug fixes:<br />
<br />
* Installing and uninstalling the same script many times does not work properly. ({{GitTicket|1353}})<br />
* GM_xmlhttpRequest() does not work in Firefox 5 betas. ({{GitTicket|1354}})<br />
* (Introduced in 0.9.4:) Cannot enable nor disable scripts. ({{GitTicket|1355}})<br />
* Installing the first user script while the user scripts pane of the add-ons manager is open leaves the "no user scripts" warning. ({{GitTicket|1356}})<br />
<br />
Enhancements:<br />
<br />
* The installation dialog shows the script version, if provided with @version. ({{GitTicket|1349}})<br />
<br />
=== 0.9.4 ===<br />
<br />
'''Note:''' Not publicly released due to bugs.<br />
<br />
May 24, 2011<br />
[http://www.greasespot.net/2011/05/greasemonkey-094-release.html]<br />
<br />
Bug fixes:<br />
<br />
* The GM_openInTab() API again returns a handle to the window object. ({{GitTicket|1298}})<br />
* Using alert() will not break setTimeout() nor GM_xmlhttpRequest(). ({{GitTicket|1318}})<br>'''Note:''' we currently only have a work-around in place, watch mozilla bug 647727 for a real fix.<br />
<br />
Enhancements:<br />
<br />
* When re-ordering execution of scripts: clicking the first/last item disables sooner/later items, and picking any of these will switch to Execution Order sort (if it is not already selected).<br />
* Removed the detail view for user scripts, which did not contain any more information than the list view.<br />
<br />
=== 0.9.3 ===<br />
<br />
April 28, 2011<br />
[http://www.greasespot.net/2011/04/greasemonkey-093-release.html]<br />
<br />
Bug fixes:<br />
<br />
* Error message logged ("Redeclaration of const document")/high CPU usage when closing the sidebar. ({{GitTicket|1226}}, {{GitTicket|1298}})<br />
* Navigating to a .user.js inside a frame works like anywhere else. ({{GitTicket|1248}})<br />
* The list of user scripts in the Add-ons Manager would sometimes forget its sort order. ({{GitTicket|1307}})<br />
* Compatibility enhancement with AutoPager (broken in 0.9.2). ({{GitTicket|1344}})<br />
* Passing a non-function to GM_registerMenuCommand()'s commandFunc broke the entire menu, and items showed up in the wrong order (both broken in 0.9.2). ({{GitTicket|1346}}, {{GitTicket|1347}})<br />
<br />
Enhancements:<br />
<br />
* Passing the Referer header works, for GM_xmlhttpRequest(). ({{GitTicket|1240}})<br />
* Accessibility: The sort buttons in the Add-ons Manager work with keyboard input (space/enter). ({{GitTicket|1345}})<br />
<br />
=== 0.9.2 ===<br />
<br />
April 5, 2011<br />
[http://www.greasespot.net/2011/03/greasemonkey-092-release.html]<br />
<br />
Bug Fixes:<br />
<br />
* Failure on OSX when Growl is installed, but not running. ({{GitTicket|1264}})<br />
* Incorrect display of Greasemonkey icon in Add-ons window (Firefox 3.6, OS X). ({{GitTicket|1284}}, {{GitTicket|1291}})<br />
* Provide a sort bar, to control display order of the scripts in the Add-ons manager, for Firefox 4. ({{GitTicket|1293}})<br />
* Remove "accelerator" keys from GM_registerMenuCommand(). ({{GitTicket|1312}}, [http://www.greasespot.net/2011/04/gmregistermenucommand-losing.html])<br />
* Work around incompatibility with Personas Plus extension. ({{GitTicket|1253}})<br />
<br />
Enhancements:<br />
<br />
* Provide a toolbar button, and remove the status bar icon for Firefox 4. ({{GitTicket|1227}})<br />
* When re-installing a script (e.g. for an update), keep it in the same execution order. ({{GitTicket|1267}})<br />
* Keep the add-ons manager view up to date when changing (installing/enabling/disabling/etc) user scripts. ({{GitTicket|1305}})<br />
<br />
=== 0.9.1 ===<br />
<br />
January 24, 2011<br />
[http://www.greasespot.net/2011/01/greasemonkey-091-release.html]<br />
<br />
Bug fixes:<br />
<br />
* Fix user script sandbox wrapping. This deals with lots of problems like <code>eval()</code>. ({{GitTicket|1258}}, also {{GitTicket|1254}}, {{GitTicket|1260}}, {{GitTicket|1263}}, {{GitTicket|1265}})<br />
* Fixed rare bug when installing scripts. ({{GitTicket|1250}})<br />
* Fixed errors when Growl is not installed on Mac OS X. ({{GitTicket|1249}})<br />
* Fixed problems with relative @require imperatives. ({{GitTicket|1262}})<br />
<br />
New features:<br />
<br />
* Allow sorting by descending (as well as ascending) execution order. ({{GitTicket|1217}})<br />
<br />
=== 0.9.0 ===<br />
<br />
January 18, 2011<br />
[http://www.greasespot.net/2010/11/greasemonkey-090-release.html]<br />
<br />
Features:<br />
<br />
* Compatibility with Firefox 4! Firefox 4 support is still preliminary. Everything probably works, but not everything works really well. The backlog of bugs for the next release is primarily focused on this.<br />
* Complete integration with the standard Firefox Add-ons dialog, treating User Scripts as just another kind of browser add-on. (See the reference link above for screenshots.)<br />
* A global options dialog, where the script editor can always be selected. ({{GitTicket|1012}}, {{GitTicket|1109}})<br />
* Live in-place editing for the entire script, including metadata (<code>@name</code>, <code>@require</code>, <code>@include</code>, <code>@exclude</code>, etc.). ({{GitTicket|1148}}, {{GitTicket|1157}}, {{GitTicket|1165}})<br />
* Web pages that end in .user.js are loaded as normal, instead of being installed as a user script. ({{GitTicket|1184}})<br />
<br />
Bug fixes / minor enhancements:<br />
<br />
* All Greasemonkey windows respond to standard close window keyboard shortcuts. ({{GitTicket|1085}})<br />
* Support for @icon metadata imperative, displayed in the new add-ons manager integration. ({{GitTicket|1096}})<br />
* Support user and password for <code>[[GM_xmlhttpRequest]]()</code>. ({{GitTicket|1100}})<br />
* Support @version metadata imperative. ({{GitTicket|1110}})<br />
* Suppress spurious <tt>Error: not well-formed (// ==UserScript==)</tt> error messages. ({{GitTicket|1134}})<br />
* The "install" menu item is removed. ({{GitTicket|1196}})<br />
<br />
== 0.8 ==<br />
<br />
=== 0.8.20100408.6 ===<br />
<br />
April 8, 2010<br />
[http://www.greasespot.net/2010/04/greasemonkey-086-release.html]<br />
<br />
Features:<br />
<br />
* Add a hidden preference to allow greasing the unmht: scheme. ({{GitTicket|1038}})<br />
* Allow relative URLs to be used for GM_xmlhttpRequest(), just like standard XMLHttpRequest. ({{GitTicket|1057}})<br />
* Performance enhancements and code improvements to internal logic behind @include and @exclude rules. ({{GitTicket|1070}} {{GitTicket|1074}} {{GitTicket|1089}})<br />
* Added translations: ca-ES, cs, fr, nl, sr-RS, vi.<br />
<br />
Bug fixes:<br />
<br />
* GM_xmlhttpRequest() can fail when Object.prototype has been modified. ({{GitTicket|1065}})<br />
* Two warnings upon making new script via "New User Script". ({{GitTicket|1069}})<br />
* Installing scripts from the hard drive (instead of via the web) can fail. ({{GitTicket|1077}})<br />
* Fix a flaw that could allow websites to prevent Greasemonkey from running. ({{GitTicket|1082}})<br />
* Error "this.menuCommanders is undefined" bug when closing a browser window. ({{GitTicket|1087}})<br />
* Error "ScriptDownloader is not defined" when performing view source on a user script. ({{GitTicket|1091}})<br />
<br />
=== 0.8.20100211.5 ===<br />
<br />
February 11, 2010<br />
[http://www.greasespot.net/2010/02/greasemonkey-085-release.html]<br />
<br />
* Add an abort() method for GM_xmlhttpRequest. ({{GitTicket|1007}})<br />
* Increase compatibility with bleeding-edge Firefox versions. ({{GitTicket|1054}})<br />
* Display a "welcome" page to new users when they install. ({{GitTicket|1006}})<br />
* Fix hooking into the console object for Firebug 1.5.<br />
<br />
=== 0.8.20091209.4 ===<br />
<br />
December 8, 2009<br />
[http://www.greasespot.net/2009/12/greasemonkey-084-released.html]<br />
<br />
* Properly specify the .finalUrl for [[GM_xmlhttpRequest]] results. ({{GitTicket|1063}})<br />
<br />
=== 0.8.20090920.2 ===<br />
<br />
September 26, 2009<br />
[http://www.greasespot.net/2009/09/greasemonkey-082-released.html]<br />
* Do not inject scripts into file: and about: URLs by default, for security reasons. ({{GitTicket|1000}})<br />
* The GM_openInTab() function respects the background loading tab behavior from Firefox preferences. ({{GitTicket|1003}})<br />
* Specify label/control associations in "New Script" dialog, for accessibility. ({{GitTicket|1010}})<br />
* Minor code clean ups and improvements. ({{GitTicket|1011}}, {{GitTicket|1020}})<br />
* Remove "forced" upgrade code. ({{GitTicket|1013}})<br />
* Remove extra spacing around the status bar icon. ({{GitTicket|1014}})<br />
* When adding include/exclude rules, include the port number in the default suggestion. ({{GitTicket|1015}})<br />
* Reduce noise logged to the console when interacting with Firebug. ({{GitTicket|1018}})<br />
* Apply security checks to GM_listValues() and GM_deleteValue(). ({{GitTicket|1019}})<br />
* Fix missing localized strings in various locales. ({{GitTicket|1022}})<br />
* Grease pages loaded into the sidebar. ({{GitTicket|1023}})<br />
* Allow user scripts to access the latest available JavaScript engine. ({{GitTicket|1026}})<br />
<br />
=== 0.8.20090123.1 ===<br />
<br />
February 18th, 2009<br />
[http://www.greasespot.net/2009/01/greasemonkey-release-08200901231.html]<br />
<br />
* Added translations: ar-SA, bn-IN, hu-HU, id-ID, ro-RO, sr-RS, vi-VN.<br />
* Fix for ticket #111 (anomalous separators in the monkey menu).<br />
* Added [[GM_deleteValue|GM_deleteValue]] and [[GM_listValues|GM_listValues]] APIs (#38).<br />
* Restore the anonymous function wrapper around scripts, and thus the same behavior as versions prior to 0.8 (by default, removable with the [[Metadata Block#.40unwrap|@unwrap]] metadata imperative, #108).<br />
* Improved interaction with the [[Useful_Tools_for_Script_Writers#FireBug|Firebug]] console (#122, #204).<br />
<br />
=== 0.8.20080609.0 ===<br />
<br />
June 12th, 2008<br />
[http://www.greasespot.net/2008/06/greasemonkey-version-08.html]<br />
<br />
* New metadata: [[Metadata Block#.40resource|@resource]], [[Metadata Block#.40resource|@require]].<br />
* New API functions: [[GM_getResourceURL]], [[GM_getResourceText]]<br />
* New property of [[GM_xmlhttpRequest]] return: [[GM_xmlhttpRequest#finalUrl|finalUrl]]<br />
* Internal code improvements<br />
* New graphics by Pak-Kei Mak, icons in the Add Ons dialog and Status Bar<br />
<br />
== 0.7 ==<br />
<br />
=== 0.7.20080121.0 ===<br />
<br />
Jan 21st, 2008<br />
[http://www.greasespot.net/2008/01/greasemonkey-security-update.html]<br />
<br />
* Security release where [[GM_xmlhttpRequest]], [[GM_getValue]] and [[GM_setValue]] were hardened against a privilege escalation attack targeting specific user scripts accessing anything through [[unsafeWindow]], thus gaining content code unrestricted access to those methods (thanks Anthony Lieuallen).<br/> This change breaks backwards compatibility for scripts granting page code direct or limited access to either method via function references on unsafeWindow; see [[0.7.20080121.0 compatibility]] for available workarounds.<br />
<br />
=== 0.7.0 ===<br />
<br />
May 24th, 2007<br />
[http://www.greasespot.net/2007/05/greasemonkey-07-candidate.html]<br />
<br />
* Fixed the bug where you can't install scripts if you have never disabled Greasemonkey.<br />
* Fixed the bug where drag and drop in the manage dialog only works once per view.<br />
* Fixed the bug where removing a script in the manage dialog also removes the last script.<br />
<br />
== 0.6 ==<br />
<br />
=== 0.6.9 ===<br />
<br />
May 9th, 2007<br />
[http://www.greasespot.net/2007/05/greasemonkey-069-gmscripts-directory.html]<br />
<br />
Introduced:<br />
* You can now reorder the scripts in the manage dialog with drag drop or the arrow keys.<br />
* You can now use [[Useful_Tools_for_Script_Writers#FireBug|Firebug]]'s console object to debug Greasemonkey if you have Firebug installed.<br />
* Fix bug where install dialog would pop up when Greasemonkey is disabled.<br />
* Make Greasemonkey enable/disable keyboard accessible. #9<br />
<br />
=== 0.6.8 ===<br />
<br />
March 17th, 2007<br />
[http://www.greasespot.net/2007/03/greasemonkey-068-new-script-ui-now.html]<br />
<br />
Introduced:<br />
<br />
* Rewrite of 'New Script...' UI. It now pops up a nice UI to get the script details and then generates and opens a script which is already installed that you can edit in one step. This is a huge improvement in the usability of this feature. Thanks to Anthony Lieuallen for the implementation.<br />
* Improvements to error reporting. Most types of errors in user scripts now give the correct line number in the error message. You can also click on the filename in [[Useful_Tools_for_Script_Writers#FireBug|Firebug]] to view the script, as with other types of errors in Firefox. Anthony is also responsible for this improvement.<br />
* Added support for [[GM_xmlhttpRequest#overrideMimeType|overrideMimeType]] to [[GM_xmlhttpRequest]]. Thanks to Lior Zur for the patch. To use, add overrideMimeType: "yourmimetypehere" to the object you pass to GM_xmlhttpRequest.<br />
* New translations for Finnish, Japanese, and Russian. The Greasemonkey UI looks particularly cool in Japanese. Thanks to Tommi Rautava, Hisateru Tanaka, and Александр Соколов for their contributions.<br />
<br />
=== 0.6.7 ===<br />
<br />
February 7th, 2007<br />
[http://www.greasespot.net/2007/02/greasemonkey-067-minor-ui-tweaks-new.html]<br />
<br />
Introduced:<br />
<br />
* Fixed the manage dialog so that it doesn't bounce around when you select different user scripts (thanks Anthony Lieuallen)<br />
* Added Basque translation (thanks 3ARRANO)<br />
* Updated German translation (thanks Matthias Bauer)<br />
* Middle-click on monkey icon now opens manage dialog, right-click on scripts in monkey menu opens them in an editor (thanks LouCypher and pile0nades)<br />
<br />
=== 0.6.6 ===<br />
<br />
October 16th, 2006<br />
[http://greaseblog.blogspot.com/2006/10/greasemonkey-066-firefox-2-support-and.html]<br />
<br />
Introduced:<br />
* Spiffy new installation dialog which more closely resembles the extension installation dialog, and presents more details in a user-friendly way.<br />
* Spanish language support.<br />
<br />
=== 0.6.5 ===<br />
<br />
July 28th, 2006<br />
[http://greasemonkey.mozdev.org/changes/0.6.5.20060727.html]<br />
<br />
Multiple versions released in separate places; largely to the Greasemonkey mailing list.<br />
Introduced:<br />
* Compatibility with Firefox 2.0.<br />
* Foreign language support for Czech, Dutch, and German.<br />
<br />
=== 0.6.4 ===<br />
<br />
November 30th, 2005<br />
[http://greaseblog.blogspot.com/2005/11/greasemonkey-064_30.html]<br />
[http://greasemonkey.mozdev.org/changes/0.6.4.html]<br />
<br />
Introduced:<br />
??<br />
<br />
=== 0.6.2 ===<br />
<br />
September 12th, 2005<br />
[http://greaseblog.blogspot.com/2005/09/firefox-15-compatible-greasemonkey.html]<br />
<br />
Introduced:<br />
* Compatibility with Firefox 1.5.<br />
* The [[Greasemonkey_Manual:Monkey_Menu|Monkey Menu]], a context menu for the status bar item added in 0.3 beta.<br />
* Simplified script installation dialogs.<br />
<br />
=== 0.6.1 ===<br />
September 9th-ish, 2005<br />
<br />
"The Lost Version"<br />
<br />
Prerelease showing of:<br />
* [[GM_addStyle|GM_addStyle]] (From release 0.6.1.4... I probably have this archived somewhere LOL)<br />
* The [[Greasemonkey_Manual:Monkey_Menu|Monkey Menu]], a context menu for the status bar item added in 0.3 beta.<br />
* Simplified script installation dialogs.<br />
<br />
Some sort of mad scramble occurred on this week when Firefox 1.5b1 was released and this version was lost but not forgotten.<br />
<br />
== 0.5 ==<br />
<br />
=== 0.5.3 ===<br />
<br />
September 3rd, 2005<br />
[http://greaseblog.blogspot.com/2005/09/053-available.html]<br />
[http://greasemonkey.mozdev.org/changes/0.5.3.html]<br />
<br />
=== 0.5.2 ===<br />
<br />
September 1st, 2005<br />
[http://greaseblog.blogspot.com/2005/09/035-051-migration-madness.html]<br />
<br />
Released to the Greasemonkey mailing list, fixed bugs in the automatic migration system for the changes between the 0.3 and 0.5 branches.<br />
<br />
=== 0.5.1 ===<br />
<br />
August 25, 2005<br />
[http://greaseblog.blogspot.com/2005/08/greasemonkey-051-final.html]<br />
[http://greasemonkey.mozdev.org/changes/0.5.1.html]<br />
<br />
Introduced:<br />
* Security fix wherein a [[user script]] could elevate itself to chrome privileges.<br />
* User can select the editor to use for "Edit" in manage, and "New User Script".<br />
* Unicode support for non-english characters.<br />
<br />
=== 0.5 beta ===<br />
<br />
July 30th, 2005<br />
[http://greaseblog.blogspot.com/2005/07/greasemonkey-05-beta.html]<br />
[http://greasemonkey.mozdev.org/changes/0.5.html]<br />
<br />
The first release containing [[security]] fixes over 0.3.5 intended for public consumption.<br />
"Greasemonkey 0.5 is actually the combination of a massive security audit and all the new code which was planned for 0.4."<br />
<br />
Introduced:<br />
* [[GM_openInTab]], [[unsafeWindow]]<br />
* Enhancements to [[GM_registerMenuCommand]]: keyboard shortcuts, stability.<br />
* Memory leak fixes.<br />
* "New User Script" menu item, shortcut to a new blank template for [[user script]] authors.<br />
* Restricted [[GM_xmlhttpRequest]] from accessing local <code>file://</code> URLs.<br />
<br />
== 0.4 ==<br />
<br />
=== 0.4.x ===<br />
<br />
''Details needed.''<br />
<br />
The 0.4 branch was an internal development version, where experimentation for security fixes happened.<br />
<br />
== 0.3 ==<br />
<br />
<br />
=== 0.3.5 ===<br />
<br />
July 19th, 2005<br />
[http://greaseblog.blogspot.com/2005/07/mandatory-greasemonkey-update.html]<br />
[http://greasemonkey.mozdev.org/changes/0.3.5.html]<br />
<br />
[[Security]] flaw release.<br />
Contained no fixes, rather removed all vulnerable features.<br />
Intended for (limited) continued use while fixes were being performed.<br />
<br />
=== 0.3.4 ===<br />
<br />
May 12th, 2005<br />
[http://greasemonkey.mozdev.org/changes/0.3.4.html]<br />
<br />
Introduced:<br />
* ".tld" support in @include/@exclude, allowing things like <code>@include <nowiki>http://www.example.tld/</nowiki></code> for all international permutations.<br />
* Log level option for [[GM_log]]<br />
* Minor enhancements and bugfixes.<br />
<br />
=== 0.3.3 ===<br />
<br />
May 10th, 2005<br />
[http://greaseblog.blogspot.com/2005/05/greasemonkey-033-beta.html]<br />
[http://greasemonkey.mozdev.org/changes/0.3.3.html]<br />
<br />
Primarily bugfix release.<br />
<br />
=== 0.3 beta ===<br />
<br />
April 23rd, 2005<br />
[http://greaseblog.blogspot.com/2005/04/greasemonkey-03b-beta.html]<br />
[http://greasemonkey.mozdev.org/changes/0.3b.html]<br />
<br />
Introduced:<br />
* Edit button in the manage dialog.<br />
* Monkey icon in the status bar, click to enable/disable.<br />
* [[GM_getValue]], [[GM_setValue]], [[GM_log]]<br />
<br />
== 0.2 ==<br />
<br />
=== 0.2.6 ===<br />
<br />
March 30th, 2005<br />
[http://greaseblog.blogspot.com/2005/03/greasemonkey-026-now-with-less-fatal.html]<br />
[http://greasemonkey.mozdev.org/changes/0.2.6.html]<br />
<br />
Bugfix release.<br />
<br />
=== 0.2.5 ===<br />
<br />
March 28th, 2005<br />
[http://greaseblog.blogspot.com/2005/03/greasemonkey-025-xmlhttp-across.html]<br />
[http://greasemonkey.mozdev.org/changes/0.2.5.html]<br />
<br />
Introduced:<br />
* [[GM_xmlhttpRequest]]<br />
* [[GM_registerMenuCommand]]<br />
<br />
Also, the default user scripts that were bundled with [[Greasemonkey]] by default until this point were removed.</div>Kwahhttps://wiki.greasespot.net/index.php?title=Version_history&diff=6579Version history2011-08-09T11:09:21Z<p>Kwah: revert spammish 'comment'</p>
<hr />
<div><div style="float:right; margin-left:1em;" class="hidenumbers">__TOC__</div><br />
<br />
== 0.9 ==<br />
<br />
=== 0.9.8 ===<br />
<br />
August 1, 2011<br />
[http://www.greasespot.net/2011/08/greasemonkey-098-release.html]<br />
<br />
Bug fixes:<br />
<br />
* User scripts cannot run in any about: pages besides about:blank. (Security enhancement; {{GitTicket|1375}})<br />
<br />
Enhancements:<br />
<br />
* Global, user specified, @exclude rules. ({{GitTicket|1002}})<br />
* New [[Metadata block#.40match|@match]] metadata imperative, which supports value document-start, as well as the standard document-end behavior. ({{GitTicket|1103}})<br />
* Support for [[Metadata block#.40run-at|@run-at]] metadata imperative, as implemented by Google Chrome. Thanks to [https://github.com/scriptish/scriptish/ Scriptish] for original implementation. ({{GitTicket|1377}})<br />
* Support for full regular expression syntax in [[Include and exclude rules]]. ({{GitTicket|1378}})<br />
<br />
=== 0.9.7 ===<br />
<br />
July 14, 2011<br />
[http://www.greasespot.net/2011/07/greasemonkey-097-release.html]<br />
<br />
Bug fixes:<br />
<br />
* Scripts with broken @icons will install, just with no icon. ({{GitTicket|1214}})<br />
* Editing the @icon line of a script will take effect immediately. ({{GitTicket|1215}})<br />
* Remote resources (@require, @resource, @icon) that redirect to other URLs will now work. ({{GitTicket|1222}})<br />
<br />
Enhancements:<br />
<br />
* Compatibility with Firefox 6 and 7. ({{GitTicket|1357})<br />
* [[GM_openInTab]]() will respect the <code>insertRelatedAfterCurrent</code> preference. ({{GitTicket|1370}})<br />
<br />
=== 0.9.6 ===<br />
<br />
June 24, 2011<br />
[http://www.greasespot.net/2011/06/greasemonkey-096-release.html]<br />
<br />
Bug fixes:<br />
<br />
* [[GM_openInTab]]() fails in Firefox 3. ({{GitTicket|1361}})<br />
* Firefox 5: Error in Add-ons Manager. ({{GitTicket|1367}})<br />
<br />
Enhancements:<br />
<br />
* Add "get user scripts" link to the Add-ons Manager. ({{GitTicket|1213}})<br />
* Pass site cookies when downloading scripts. ({{GitTicket|1359}})<br />
<br />
=== 0.9.5 ===<br />
<br />
May 26, 2011<br />
[http://www.greasespot.net/2011/05/greasemonkey-095-release.html]<br />
<br />
Bug fixes:<br />
<br />
* Installing and uninstalling the same script many times does not work properly. ({{GitTicket|1353}})<br />
* GM_xmlhttpRequest() does not work in Firefox 5 betas. ({{GitTicket|1354}})<br />
* (Introduced in 0.9.4:) Cannot enable nor disable scripts. ({{GitTicket|1355}})<br />
* Installing the first user script while the user scripts pane of the add-ons manager is open leaves the "no user scripts" warning. ({{GitTicket|1356}})<br />
<br />
Enhancements:<br />
<br />
* The installation dialog shows the script version, if provided with @version. ({{GitTicket|1349}})<br />
<br />
=== 0.9.4 ===<br />
<br />
'''Note:''' Not publicly released due to bugs.<br />
<br />
May 24, 2011<br />
[http://www.greasespot.net/2011/05/greasemonkey-094-release.html]<br />
<br />
Bug fixes:<br />
<br />
* The GM_openInTab() API again returns a handle to the window object. ({{GitTicket|1298}})<br />
* Using alert() will not break setTimeout() nor GM_xmlhttpRequest(). ({{GitTicket|1318}})<br>'''Note:''' we currently only have a work-around in place, watch mozilla bug 647727 for a real fix.<br />
<br />
Enhancements:<br />
<br />
* When re-ordering execution of scripts: clicking the first/last item disables sooner/later items, and picking any of these will switch to Execution Order sort (if it is not already selected).<br />
* Removed the detail view for user scripts, which did not contain any more information than the list view.<br />
<br />
=== 0.9.3 ===<br />
<br />
April 28, 2011<br />
[http://www.greasespot.net/2011/04/greasemonkey-093-release.html]<br />
<br />
Bug fixes:<br />
<br />
* Error message logged ("Redeclaration of const document")/high CPU usage when closing the sidebar. ({{GitTicket|1226}}, {{GitTicket|1298}})<br />
* Navigating to a .user.js inside a frame works like anywhere else. ({{GitTicket|1248}})<br />
* The list of user scripts in the Add-ons Manager would sometimes forget its sort order. ({{GitTicket|1307}})<br />
* Compatibility enhancement with AutoPager (broken in 0.9.2). ({{GitTicket|1344}})<br />
* Passing a non-function to GM_registerMenuCommand()'s commandFunc broke the entire menu, and items showed up in the wrong order (both broken in 0.9.2). ({{GitTicket|1346}}, {{GitTicket|1347}})<br />
<br />
Enhancements:<br />
<br />
* Passing the Referer header works, for GM_xmlhttpRequest(). ({{GitTicket|1240}})<br />
* Accessibility: The sort buttons in the Add-ons Manager work with keyboard input (space/enter). ({{GitTicket|1345}})<br />
<br />
=== 0.9.2 ===<br />
<br />
April 5, 2011<br />
[http://www.greasespot.net/2011/03/greasemonkey-092-release.html]<br />
<br />
Bug Fixes:<br />
<br />
* Failure on OSX when Growl is installed, but not running. ({{GitTicket|1264}})<br />
* Incorrect display of Greasemonkey icon in Add-ons window (Firefox 3.6, OS X). ({{GitTicket|1284}}, {{GitTicket|1291}})<br />
* Provide a sort bar, to control display order of the scripts in the Add-ons manager, for Firefox 4. ({{GitTicket|1293}})<br />
* Remove "accelerator" keys from GM_registerMenuCommand(). ({{GitTicket|1312}}, [http://www.greasespot.net/2011/04/gmregistermenucommand-losing.html])<br />
* Work around incompatibility with Personas Plus extension. ({{GitTicket|1253}})<br />
<br />
Enhancements:<br />
<br />
* Provide a toolbar button, and remove the status bar icon for Firefox 4. ({{GitTicket|1227}})<br />
* When re-installing a script (e.g. for an update), keep it in the same execution order. ({{GitTicket|1267}})<br />
* Keep the add-ons manager view up to date when changing (installing/enabling/disabling/etc) user scripts. ({{GitTicket|1305}})<br />
<br />
=== 0.9.1 ===<br />
<br />
January 24, 2011<br />
[http://www.greasespot.net/2011/01/greasemonkey-091-release.html]<br />
<br />
Bug fixes:<br />
<br />
* Fix user script sandbox wrapping. This deals with lots of problems like <code>eval()</code>. ({{GitTicket|1258}}, also {{GitTicket|1254}}, {{GitTicket|1260}}, {{GitTicket|1263}}, {{GitTicket|1265}})<br />
* Fixed rare bug when installing scripts. ({{GitTicket|1250}})<br />
* Fixed errors when Growl is not installed on Mac OS X. ({{GitTicket|1249}})<br />
* Fixed problems with relative @require imperatives. ({{GitTicket|1262}})<br />
<br />
New features:<br />
<br />
* Allow sorting by descending (as well as ascending) execution order. ({{GitTicket|1217}})<br />
<br />
=== 0.9.0 ===<br />
<br />
January 18, 2011<br />
[http://www.greasespot.net/2010/11/greasemonkey-090-release.html]<br />
<br />
Features:<br />
<br />
* Compatibility with Firefox 4! Firefox 4 support is still preliminary. Everything probably works, but not everything works really well. The backlog of bugs for the next release is primarily focused on this.<br />
* Complete integration with the standard Firefox Add-ons dialog, treating User Scripts as just another kind of browser add-on. (See the reference link above for screenshots.)<br />
* A global options dialog, where the script editor can always be selected. ({{GitTicket|1012}}, {{GitTicket|1109}})<br />
* Live in-place editing for the entire script, including metadata (<code>@name</code>, <code>@require</code>, <code>@include</code>, <code>@exclude</code>, etc.). ({{GitTicket|1148}}, {{GitTicket|1157}}, {{GitTicket|1165}})<br />
* Web pages that end in .user.js are loaded as normal, instead of being installed as a user script. ({{GitTicket|1184}})<br />
<br />
Bug fixes / minor enhancements:<br />
<br />
* All Greasemonkey windows respond to standard close window keyboard shortcuts. ({{GitTicket|1085}})<br />
* Support for @icon metadata imperative, displayed in the new add-ons manager integration. ({{GitTicket|1096}})<br />
* Support user and password for <code>[[GM_xmlhttpRequest]]()</code>. ({{GitTicket|1100}})<br />
* Support @version metadata imperative. ({{GitTicket|1110}})<br />
* Suppress spurious <tt>Error: not well-formed (// ==UserScript==)</tt> error messages. ({{GitTicket|1134}})<br />
* The "install" menu item is removed. ({{GitTicket|1196}})<br />
<br />
== 0.8 ==<br />
<br />
=== 0.8.20100408.6 ===<br />
<br />
April 8, 2010<br />
[http://www.greasespot.net/2010/04/greasemonkey-086-release.html]<br />
<br />
Features:<br />
<br />
* Add a hidden preference to allow greasing the unmht: scheme. ({{GitTicket|1038}})<br />
* Allow relative URLs to be used for GM_xmlhttpRequest(), just like standard XMLHttpRequest. ({{GitTicket|1057}})<br />
* Performance enhancements and code improvements to internal logic behind @include and @exclude rules. ({{GitTicket|1070}} {{GitTicket|1074}} {{GitTicket|1089}})<br />
* Added translations: ca-ES, cs, fr, nl, sr-RS, vi.<br />
<br />
Bug fixes:<br />
<br />
* GM_xmlhttpRequest() can fail when Object.prototype has been modified. ({{GitTicket|1065}})<br />
* Two warnings upon making new script via "New User Script". ({{GitTicket|1069}})<br />
* Installing scripts from the hard drive (instead of via the web) can fail. ({{GitTicket|1077}})<br />
* Fix a flaw that could allow websites to prevent Greasemonkey from running. ({{GitTicket|1082}})<br />
* Error "this.menuCommanders is undefined" bug when closing a browser window. ({{GitTicket|1087}})<br />
* Error "ScriptDownloader is not defined" when performing view source on a user script. ({{GitTicket|1091}})<br />
<br />
=== 0.8.20100211.5 ===<br />
<br />
February 11, 2010<br />
[http://www.greasespot.net/2010/02/greasemonkey-085-release.html]<br />
<br />
* Add an abort() method for GM_xmlhttpRequest. ({{GitTicket|1007}})<br />
* Increase compatibility with bleeding-edge Firefox versions. ({{GitTicket|1054}})<br />
* Display a "welcome" page to new users when they install. ({{GitTicket|1006}})<br />
* Fix hooking into the console object for Firebug 1.5.<br />
<br />
=== 0.8.20091209.4 ===<br />
<br />
December 8, 2009<br />
[http://www.greasespot.net/2009/12/greasemonkey-084-released.html]<br />
<br />
* Properly specify the .finalUrl for [[GM_xmlhttpRequest]] results. ({{GitTicket|1063}})<br />
<br />
=== 0.8.20090920.2 ===<br />
<br />
September 26, 2009<br />
[http://www.greasespot.net/2009/09/greasemonkey-082-released.html]<br />
* Do not inject scripts into file: and about: URLs by default, for security reasons. ({{GitTicket|1000}})<br />
* The GM_openInTab() function respects the background loading tab behavior from Firefox preferences. ({{GitTicket|1003}})<br />
* Specify label/control associations in "New Script" dialog, for accessibility. ({{GitTicket|1010}})<br />
* Minor code clean ups and improvements. ({{GitTicket|1011}}, {{GitTicket|1020}})<br />
* Remove "forced" upgrade code. ({{GitTicket|1013}})<br />
* Remove extra spacing around the status bar icon. ({{GitTicket|1014}})<br />
* When adding include/exclude rules, include the port number in the default suggestion. ({{GitTicket|1015}})<br />
* Reduce noise logged to the console when interacting with Firebug. ({{GitTicket|1018}})<br />
* Apply security checks to GM_listValues() and GM_deleteValue(). ({{GitTicket|1019}})<br />
* Fix missing localized strings in various locales. ({{GitTicket|1022}})<br />
* Grease pages loaded into the sidebar. ({{GitTicket|1023}})<br />
* Allow user scripts to access the latest available JavaScript engine. ({{GitTicket|1026}})<br />
<br />
=== 0.8.20090123.1 ===<br />
<br />
February 18th, 2009<br />
[http://www.greasespot.net/2009/01/greasemonkey-release-08200901231.html]<br />
<br />
* Added translations: ar-SA, bn-IN, hu-HU, id-ID, ro-RO, sr-RS, vi-VN.<br />
* Fix for ticket #111 (anomalous separators in the monkey menu).<br />
* Added [[GM_deleteValue|GM_deleteValue]] and [[GM_listValues|GM_listValues]] APIs (#38).<br />
* Restore the anonymous function wrapper around scripts, and thus the same behavior as versions prior to 0.8 (by default, removable with the [[Metadata Block#.40unwrap|@unwrap]] metadata imperative, #108).<br />
* Improved interaction with the [[Useful_Tools_for_Script_Writers#FireBug|Firebug]] console (#122, #204).<br />
<br />
=== 0.8.20080609.0 ===<br />
<br />
June 12th, 2008<br />
[http://www.greasespot.net/2008/06/greasemonkey-version-08.html]<br />
<br />
* New metadata: [[Metadata Block#.40resource|@resource]], [[Metadata Block#.40resource|@require]].<br />
* New API functions: [[GM_getResourceURL]], [[GM_getResourceText]]<br />
* New property of [[GM_xmlhttpRequest]] return: [[GM_xmlhttpRequest#finalUrl|finalUrl]]<br />
* Internal code improvements<br />
* New graphics by Pak-Kei Mak, icons in the Add Ons dialog and Status Bar<br />
<br />
== 0.7 ==<br />
<br />
=== 0.7.20080121.0 ===<br />
<br />
Jan 21st, 2008<br />
[http://www.greasespot.net/2008/01/greasemonkey-security-update.html]<br />
<br />
* Security release where [[GM_xmlhttpRequest]], [[GM_getValue]] and [[GM_setValue]] were hardened against a privilege escalation attack targeting specific user scripts accessing anything through [[unsafeWindow]], thus gaining content code unrestricted access to those methods (thanks Anthony Lieuallen).<br/> This change breaks backwards compatibility for scripts granting page code direct or limited access to either method via function references on unsafeWindow; see [[0.7.20080121.0 compatibility]] for available workarounds.<br />
<br />
=== 0.7.0 ===<br />
<br />
May 24th, 2007<br />
[http://www.greasespot.net/2007/05/greasemonkey-07-candidate.html]<br />
<br />
* Fixed the bug where you can't install scripts if you have never disabled Greasemonkey.<br />
* Fixed the bug where drag and drop in the manage dialog only works once per view.<br />
* Fixed the bug where removing a script in the manage dialog also removes the last script.<br />
<br />
== 0.6 ==<br />
<br />
=== 0.6.9 ===<br />
<br />
May 9th, 2007<br />
[http://www.greasespot.net/2007/05/greasemonkey-069-gmscripts-directory.html]<br />
<br />
Introduced:<br />
* You can now reorder the scripts in the manage dialog with drag drop or the arrow keys.<br />
* You can now use [[Useful_Tools_for_Script_Writers#FireBug|Firebug]]'s console object to debug Greasemonkey if you have Firebug installed.<br />
* Fix bug where install dialog would pop up when Greasemonkey is disabled.<br />
* Make Greasemonkey enable/disable keyboard accessible. #9<br />
<br />
=== 0.6.8 ===<br />
<br />
March 17th, 2007<br />
[http://www.greasespot.net/2007/03/greasemonkey-068-new-script-ui-now.html]<br />
<br />
Introduced:<br />
<br />
* Rewrite of 'New Script...' UI. It now pops up a nice UI to get the script details and then generates and opens a script which is already installed that you can edit in one step. This is a huge improvement in the usability of this feature. Thanks to Anthony Lieuallen for the implementation.<br />
* Improvements to error reporting. Most types of errors in user scripts now give the correct line number in the error message. You can also click on the filename in [[Useful_Tools_for_Script_Writers#FireBug|Firebug]] to view the script, as with other types of errors in Firefox. Anthony is also responsible for this improvement.<br />
* Added support for [[GM_xmlhttpRequest#overrideMimeType|overrideMimeType]] to [[GM_xmlhttpRequest]]. Thanks to Lior Zur for the patch. To use, add overrideMimeType: "yourmimetypehere" to the object you pass to GM_xmlhttpRequest.<br />
* New translations for Finnish, Japanese, and Russian. The Greasemonkey UI looks particularly cool in Japanese. Thanks to Tommi Rautava, Hisateru Tanaka, and Александр Соколов for their contributions.<br />
<br />
=== 0.6.7 ===<br />
<br />
February 7th, 2007<br />
[http://www.greasespot.net/2007/02/greasemonkey-067-minor-ui-tweaks-new.html]<br />
<br />
Introduced:<br />
<br />
* Fixed the manage dialog so that it doesn't bounce around when you select different user scripts (thanks Anthony Lieuallen)<br />
* Added Basque translation (thanks 3ARRANO)<br />
* Updated German translation (thanks Matthias Bauer)<br />
* Middle-click on monkey icon now opens manage dialog, right-click on scripts in monkey menu opens them in an editor (thanks LouCypher and pile0nades)<br />
<br />
=== 0.6.6 ===<br />
<br />
October 16th, 2006<br />
[http://greaseblog.blogspot.com/2006/10/greasemonkey-066-firefox-2-support-and.html]<br />
<br />
Introduced:<br />
* Spiffy new installation dialog which more closely resembles the extension installation dialog, and presents more details in a user-friendly way.<br />
* Spanish language support.<br />
<br />
=== 0.6.5 ===<br />
<br />
July 28th, 2006<br />
[http://greasemonkey.mozdev.org/changes/0.6.5.20060727.html]<br />
<br />
Multiple versions released in separate places; largely to the Greasemonkey mailing list.<br />
Introduced:<br />
* Compatibility with Firefox 2.0.<br />
* Foreign language support for Czech, Dutch, and German.<br />
<br />
=== 0.6.4 ===<br />
<br />
November 30th, 2005<br />
[http://greaseblog.blogspot.com/2005/11/greasemonkey-064_30.html]<br />
[http://greasemonkey.mozdev.org/changes/0.6.4.html]<br />
<br />
Introduced:<br />
??<br />
<br />
=== 0.6.2 ===<br />
<br />
September 12th, 2005<br />
[http://greaseblog.blogspot.com/2005/09/firefox-15-compatible-greasemonkey.html]<br />
<br />
Introduced:<br />
* Compatibility with Firefox 1.5.<br />
* The [[Greasemonkey_Manual:Monkey_Menu|Monkey Menu]], a context menu for the status bar item added in 0.3 beta.<br />
* Simplified script installation dialogs.<br />
<br />
=== 0.6.1 ===<br />
September 9th-ish, 2005<br />
<br />
"The Lost Version"<br />
<br />
Prerelease showing of:<br />
* [[GM_addStyle|GM_addStyle]] (From release 0.6.1.4... I probably have this archived somewhere LOL)<br />
* The [[Greasemonkey_Manual:Monkey_Menu|Monkey Menu]], a context menu for the status bar item added in 0.3 beta.<br />
* Simplified script installation dialogs.<br />
<br />
Some sort of mad scramble occurred on this week when Firefox 1.5b1 was released and this version was lost but not forgotten.<br />
<br />
== 0.5 ==<br />
<br />
=== 0.5.3 ===<br />
<br />
September 3rd, 2005<br />
[http://greaseblog.blogspot.com/2005/09/053-available.html]<br />
[http://greasemonkey.mozdev.org/changes/0.5.3.html]<br />
<br />
=== 0.5.2 ===<br />
<br />
September 1st, 2005<br />
[http://greaseblog.blogspot.com/2005/09/035-051-migration-madness.html]<br />
<br />
Released to the Greasemonkey mailing list, fixed bugs in the automatic migration system for the changes between the 0.3 and 0.5 branches.<br />
<br />
=== 0.5.1 ===<br />
<br />
August 25, 2005<br />
[http://greaseblog.blogspot.com/2005/08/greasemonkey-051-final.html]<br />
[http://greasemonkey.mozdev.org/changes/0.5.1.html]<br />
<br />
Introduced:<br />
* Security fix wherein a [[user script]] could elevate itself to chrome privileges.<br />
* User can select the editor to use for "Edit" in manage, and "New User Script".<br />
* Unicode support for non-english characters.<br />
<br />
=== 0.5 beta ===<br />
<br />
July 30th, 2005<br />
[http://greaseblog.blogspot.com/2005/07/greasemonkey-05-beta.html]<br />
[http://greasemonkey.mozdev.org/changes/0.5.html]<br />
<br />
The first release containing [[security]] fixes over 0.3.5 intended for public consumption.<br />
"Greasemonkey 0.5 is actually the combination of a massive security audit and all the new code which was planned for 0.4."<br />
<br />
Introduced:<br />
* [[GM_openInTab]], [[unsafeWindow]]<br />
* Enhancements to [[GM_registerMenuCommand]]: keyboard shortcuts, stability.<br />
* Memory leak fixes.<br />
* "New User Script" menu item, shortcut to a new blank template for [[user script]] authors.<br />
* Restricted [[GM_xmlhttpRequest]] from accessing local <code>file://</code> URLs.<br />
<br />
== 0.4 ==<br />
<br />
=== 0.4.x ===<br />
<br />
''Details needed.''<br />
<br />
The 0.4 branch was an internal development version, where experimentation for security fixes happened.<br />
<br />
== 0.3 ==<br />
<br />
<br />
=== 0.3.5 ===<br />
<br />
July 19th, 2005<br />
[http://greaseblog.blogspot.com/2005/07/mandatory-greasemonkey-update.html]<br />
[http://greasemonkey.mozdev.org/changes/0.3.5.html]<br />
<br />
[[Security]] flaw release.<br />
Contained no fixes, rather removed all vulnerable features.<br />
Intended for (limited) continued use while fixes were being performed.<br />
<br />
=== 0.3.4 ===<br />
<br />
May 12th, 2005<br />
[http://greasemonkey.mozdev.org/changes/0.3.4.html]<br />
<br />
Introduced:<br />
* ".tld" support in @include/@exclude, allowing things like <code>@include <nowiki>http://www.example.tld/</nowiki></code> for all international permutations.<br />
* Log level option for [[GM_log]]<br />
* Minor enhancements and bugfixes.<br />
<br />
=== 0.3.3 ===<br />
<br />
May 10th, 2005<br />
[http://greaseblog.blogspot.com/2005/05/greasemonkey-033-beta.html]<br />
[http://greasemonkey.mozdev.org/changes/0.3.3.html]<br />
<br />
Primarily bugfix release.<br />
<br />
=== 0.3 beta ===<br />
<br />
April 23rd, 2005<br />
[http://greaseblog.blogspot.com/2005/04/greasemonkey-03b-beta.html]<br />
[http://greasemonkey.mozdev.org/changes/0.3b.html]<br />
<br />
Introduced:<br />
* Edit button in the manage dialog.<br />
* Monkey icon in the status bar, click to enable/disable.<br />
* [[GM_getValue]], [[GM_setValue]], [[GM_log]]<br />
<br />
== 0.2 ==<br />
<br />
=== 0.2.6 ===<br />
<br />
March 30th, 2005<br />
[http://greaseblog.blogspot.com/2005/03/greasemonkey-026-now-with-less-fatal.html]<br />
[http://greasemonkey.mozdev.org/changes/0.2.6.html]<br />
<br />
Bugfix release.<br />
<br />
=== 0.2.5 ===<br />
<br />
March 28th, 2005<br />
[http://greaseblog.blogspot.com/2005/03/greasemonkey-025-xmlhttp-across.html]<br />
[http://greasemonkey.mozdev.org/changes/0.2.5.html]<br />
<br />
Introduced:<br />
* [[GM_xmlhttpRequest]]<br />
* [[GM_registerMenuCommand]]<br />
<br />
Also, the default user scripts that were bundled with [[Greasemonkey]] by default until this point were removed.</div>Kwahhttps://wiki.greasespot.net/index.php?title=Location_hack&diff=6578Location hack2011-08-09T11:07:39Z<p>Kwah: removed spammish 'comment'</p>
<hr />
<div>The '''location hack''' is an ugly but useful way to interact with the content scope of the page being [[user script]]ed. It does this by indirectly [http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Functions:eval evaling] strings within that scope.<br />
<br />
== Background ==<br />
<br />
For [[security]] reasons, [[Greasemonkey]] uses [[XPCNativeWrapper]]s and [[sandbox]] to isolate it from the web page. Under this system, the user script can access and manipulate the page using event listeners, the DOM API, and [[API reference|GM_* functions]].<br />
<br />
Sometimes the sandbox is too limiting, in which case the user script can access other parts of the page using [[unsafeWindow]]. As the name ''unsafe''Window implies, this can often be unsafe, and expose security holes.<br />
<br />
In December 2005, Jesse Ruderman [http://www.squarefree.com/2005/12/01/updated-greasemonkey-scripts/ came up with the location hack], to be an alternative to unsafeWindow in many cases.<br />
<br />
== Basic usage: page functions ==<br />
<br />
Suppose the page contains a function called <code>pageFunc</code>, or <code>window.pageFunc</code>.<br />
The user script knows this function as <code>unsafeWindow.pageFunc</code>.<br />
<br />
The user script could simply call <code>unsafeWindow.pageFunc()</code>, but this can leak the sandbox.<br />
Instead, the user script can take advantage of <code>javascript:</code> URLs, which always run in the content scope.<br />
Just entering this URL into the browser's location bar does not leak a GreaseMonkey sandbox:<br />
<br />
javascript:pageFunc();void(0)<br />
<br />
A user script can programmaticaly navigate to this URL, to safely call the function:<br />
<br />
location.assign( "javascript:pageFunc();void(0)" );<br />
<br />
That, in a nutshell, is the location hack!<br />
Essentially, it is wrapping a [[wikipedia:bookmarklet|bookmarklet]] into a user script.<br />
<br />
It's important to add the <code>javascript:</code> scheme to the front, to turn it into a URL, and the <code>;void(0)</code> to the end, which keeps the browser from actually navigating to this URL after it is run.<br />
<br />
== Modifying the page ==<br />
<br />
The location hack can do anything a page script or bookmarklet can do, so it can modify content variables and such as easily as it can access them. For example:<br />
<br />
location.href = "javascript:void(window.someVariable = 'someValue')";<br />
<br />
== Executing large blocks of code ==<br />
<br />
Executing more than one statement can become unreadable very easily. Luckily, JavaScript can convert functions to strings, so you can use:<br />
<br />
location.href = "javascript:(" + function() {<br />
// do something<br />
} + ")()";<br />
<br />
Even though the function is defined in the sandbox, it is not a closure of the sandbox scope. It is converted to a string and then back to a function in page scope. It cannot access anything in the sandbox scope, which is a limitation, but is also essential to making this technique secure.<br />
<br />
== Percent encoding issue ==<br />
<br />
Sometimes percent-encoding the percent symbol is required. For example,<br />
<br />
location.href = ("javascript:(" + function() {<br />
var n = 44;<br />
if(!('''n%22''')) alert('n is a multiple of 22');<br />
} + ")()");<br />
<br />
The above code will cause error because %22 is interpreted as double quotation mark. The workaround is:<br />
<br />
location.href = "javascript:(" + encodeURI(<br />
function() {<br />
var n = 44;<br />
if(!(n%22)) alert('n is a multiple of 22');<br />
}) + ")()";<br />
<br />
See also [http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Functions:encodeURI encodeURI()].<br />
<br />
== Returning values ==<br />
<br />
The location hack is really handy for passing values to the content scope, or to call functions defined there.<br />
It is not, however, capable of directly reading a variable or value returned from a function.<br />
Furthermore, it is run asynchronously, much like <code>setTimeout()</code>, so you cannot immediately rely on side effects.<br />
(If you use the location hack to, for example, store a value in the DOM and then attempt to read it, it will only be available at some other later point in time.)<br />
For reading javascript values from the content scope inside the sandbox, see [[Reading Content Globals]] for a reliable example.<br />
<br />
== See Also ==<br />
<br />
* [[Reading Content Globals]]<br />
* [[Content Script Injection]]<br />
<br />
[[Category:Coding Tips:Interacting With The Page]]</div>Kwahhttps://wiki.greasespot.net/index.php?title=Version_history&diff=6559Version history2011-08-08T23:14:52Z<p>Kwah: revert spammish 'comment'</p>
<hr />
<div><div style="float:right; margin-left:1em;" class="hidenumbers">__TOC__</div><br />
<br />
== 0.9 ==<br />
<br />
=== 0.9.8 ===<br />
<br />
August 1, 2011<br />
[http://www.greasespot.net/2011/08/greasemonkey-098-release.html]<br />
<br />
Bug fixes:<br />
<br />
* User scripts cannot run in any about: pages besides about:blank. (Security enhancement; {{GitTicket|1375}})<br />
<br />
Enhancements:<br />
<br />
* Global, user specified, @exclude rules. ({{GitTicket|1002}})<br />
* New [[Metadata block#.40match|@match]] metadata imperative, which supports value document-start, as well as the standard document-end behavior. ({{GitTicket|1103}})<br />
* Support for [[Metadata block#.40run-at|@run-at]] metadata imperative, as implemented by Google Chrome. Thanks to [https://github.com/scriptish/scriptish/ Scriptish] for original implementation. ({{GitTicket|1377}})<br />
* Support for full regular expression syntax in [[Include and exclude rules]]. ({{GitTicket|1378}})<br />
<br />
=== 0.9.7 ===<br />
<br />
July 14, 2011<br />
[http://www.greasespot.net/2011/07/greasemonkey-097-release.html]<br />
<br />
Bug fixes:<br />
<br />
* Scripts with broken @icons will install, just with no icon. ({{GitTicket|1214}})<br />
* Editing the @icon line of a script will take effect immediately. ({{GitTicket|1215}})<br />
* Remote resources (@require, @resource, @icon) that redirect to other URLs will now work. ({{GitTicket|1222}})<br />
<br />
Enhancements:<br />
<br />
* Compatibility with Firefox 6 and 7. ({{GitTicket|1357})<br />
* [[GM_openInTab]]() will respect the <code>insertRelatedAfterCurrent</code> preference. ({{GitTicket|1370}})<br />
<br />
=== 0.9.6 ===<br />
<br />
June 24, 2011<br />
[http://www.greasespot.net/2011/06/greasemonkey-096-release.html]<br />
<br />
Bug fixes:<br />
<br />
* [[GM_openInTab]]() fails in Firefox 3. ({{GitTicket|1361}})<br />
* Firefox 5: Error in Add-ons Manager. ({{GitTicket|1367}})<br />
<br />
Enhancements:<br />
<br />
* Add "get user scripts" link to the Add-ons Manager. ({{GitTicket|1213}})<br />
* Pass site cookies when downloading scripts. ({{GitTicket|1359}})<br />
<br />
=== 0.9.5 ===<br />
<br />
May 26, 2011<br />
[http://www.greasespot.net/2011/05/greasemonkey-095-release.html]<br />
<br />
Bug fixes:<br />
<br />
* Installing and uninstalling the same script many times does not work properly. ({{GitTicket|1353}})<br />
* GM_xmlhttpRequest() does not work in Firefox 5 betas. ({{GitTicket|1354}})<br />
* (Introduced in 0.9.4:) Cannot enable nor disable scripts. ({{GitTicket|1355}})<br />
* Installing the first user script while the user scripts pane of the add-ons manager is open leaves the "no user scripts" warning. ({{GitTicket|1356}})<br />
<br />
Enhancements:<br />
<br />
* The installation dialog shows the script version, if provided with @version. ({{GitTicket|1349}})<br />
<br />
=== 0.9.4 ===<br />
<br />
'''Note:''' Not publicly released due to bugs.<br />
<br />
May 24, 2011<br />
[http://www.greasespot.net/2011/05/greasemonkey-094-release.html]<br />
<br />
Bug fixes:<br />
<br />
* The GM_openInTab() API again returns a handle to the window object. ({{GitTicket|1298}})<br />
* Using alert() will not break setTimeout() nor GM_xmlhttpRequest(). ({{GitTicket|1318}})<br>'''Note:''' we currently only have a work-around in place, watch mozilla bug 647727 for a real fix.<br />
<br />
Enhancements:<br />
<br />
* When re-ordering execution of scripts: clicking the first/last item disables sooner/later items, and picking any of these will switch to Execution Order sort (if it is not already selected).<br />
* Removed the detail view for user scripts, which did not contain any more information than the list view.<br />
<br />
=== 0.9.3 ===<br />
<br />
April 28, 2011<br />
[http://www.greasespot.net/2011/04/greasemonkey-093-release.html]<br />
<br />
Bug fixes:<br />
<br />
* Error message logged ("Redeclaration of const document")/high CPU usage when closing the sidebar. ({{GitTicket|1226}}, {{GitTicket|1298}})<br />
* Navigating to a .user.js inside a frame works like anywhere else. ({{GitTicket|1248}})<br />
* The list of user scripts in the Add-ons Manager would sometimes forget its sort order. ({{GitTicket|1307}})<br />
* Compatibility enhancement with AutoPager (broken in 0.9.2). ({{GitTicket|1344}})<br />
* Passing a non-function to GM_registerMenuCommand()'s commandFunc broke the entire menu, and items showed up in the wrong order (both broken in 0.9.2). ({{GitTicket|1346}}, {{GitTicket|1347}})<br />
<br />
Enhancements:<br />
<br />
* Passing the Referer header works, for GM_xmlhttpRequest(). ({{GitTicket|1240}})<br />
* Accessibility: The sort buttons in the Add-ons Manager work with keyboard input (space/enter). ({{GitTicket|1345}})<br />
<br />
=== 0.9.2 ===<br />
<br />
April 5, 2011<br />
[http://www.greasespot.net/2011/03/greasemonkey-092-release.html]<br />
<br />
Bug Fixes:<br />
<br />
* Failure on OSX when Growl is installed, but not running. ({{GitTicket|1264}})<br />
* Incorrect display of Greasemonkey icon in Add-ons window (Firefox 3.6, OS X). ({{GitTicket|1284}}, {{GitTicket|1291}})<br />
* Provide a sort bar, to control display order of the scripts in the Add-ons manager, for Firefox 4. ({{GitTicket|1293}})<br />
* Remove "accelerator" keys from GM_registerMenuCommand(). ({{GitTicket|1312}}, [http://www.greasespot.net/2011/04/gmregistermenucommand-losing.html])<br />
* Work around incompatibility with Personas Plus extension. ({{GitTicket|1253}})<br />
<br />
Enhancements:<br />
<br />
* Provide a toolbar button, and remove the status bar icon for Firefox 4. ({{GitTicket|1227}})<br />
* When re-installing a script (e.g. for an update), keep it in the same execution order. ({{GitTicket|1267}})<br />
* Keep the add-ons manager view up to date when changing (installing/enabling/disabling/etc) user scripts. ({{GitTicket|1305}})<br />
<br />
=== 0.9.1 ===<br />
<br />
January 24, 2011<br />
[http://www.greasespot.net/2011/01/greasemonkey-091-release.html]<br />
<br />
Bug fixes:<br />
<br />
* Fix user script sandbox wrapping. This deals with lots of problems like <code>eval()</code>. ({{GitTicket|1258}}, also {{GitTicket|1254}}, {{GitTicket|1260}}, {{GitTicket|1263}}, {{GitTicket|1265}})<br />
* Fixed rare bug when installing scripts. ({{GitTicket|1250}})<br />
* Fixed errors when Growl is not installed on Mac OS X. ({{GitTicket|1249}})<br />
* Fixed problems with relative @require imperatives. ({{GitTicket|1262}})<br />
<br />
New features:<br />
<br />
* Allow sorting by descending (as well as ascending) execution order. ({{GitTicket|1217}})<br />
<br />
=== 0.9.0 ===<br />
<br />
January 18, 2011<br />
[http://www.greasespot.net/2010/11/greasemonkey-090-release.html]<br />
<br />
Features:<br />
<br />
* Compatibility with Firefox 4! Firefox 4 support is still preliminary. Everything probably works, but not everything works really well. The backlog of bugs for the next release is primarily focused on this.<br />
* Complete integration with the standard Firefox Add-ons dialog, treating User Scripts as just another kind of browser add-on. (See the reference link above for screenshots.)<br />
* A global options dialog, where the script editor can always be selected. ({{GitTicket|1012}}, {{GitTicket|1109}})<br />
* Live in-place editing for the entire script, including metadata (<code>@name</code>, <code>@require</code>, <code>@include</code>, <code>@exclude</code>, etc.). ({{GitTicket|1148}}, {{GitTicket|1157}}, {{GitTicket|1165}})<br />
* Web pages that end in .user.js are loaded as normal, instead of being installed as a user script. ({{GitTicket|1184}})<br />
<br />
Bug fixes / minor enhancements:<br />
<br />
* All Greasemonkey windows respond to standard close window keyboard shortcuts. ({{GitTicket|1085}})<br />
* Support for @icon metadata imperative, displayed in the new add-ons manager integration. ({{GitTicket|1096}})<br />
* Support user and password for <code>[[GM_xmlhttpRequest]]()</code>. ({{GitTicket|1100}})<br />
* Support @version metadata imperative. ({{GitTicket|1110}})<br />
* Suppress spurious <tt>Error: not well-formed (// ==UserScript==)</tt> error messages. ({{GitTicket|1134}})<br />
* The "install" menu item is removed. ({{GitTicket|1196}})<br />
<br />
== 0.8 ==<br />
<br />
=== 0.8.20100408.6 ===<br />
<br />
April 8, 2010<br />
[http://www.greasespot.net/2010/04/greasemonkey-086-release.html]<br />
<br />
Features:<br />
<br />
* Add a hidden preference to allow greasing the unmht: scheme. ({{GitTicket|1038}})<br />
* Allow relative URLs to be used for GM_xmlhttpRequest(), just like standard XMLHttpRequest. ({{GitTicket|1057}})<br />
* Performance enhancements and code improvements to internal logic behind @include and @exclude rules. ({{GitTicket|1070}} {{GitTicket|1074}} {{GitTicket|1089}})<br />
* Added translations: ca-ES, cs, fr, nl, sr-RS, vi.<br />
<br />
Bug fixes:<br />
<br />
* GM_xmlhttpRequest() can fail when Object.prototype has been modified. ({{GitTicket|1065}})<br />
* Two warnings upon making new script via "New User Script". ({{GitTicket|1069}})<br />
* Installing scripts from the hard drive (instead of via the web) can fail. ({{GitTicket|1077}})<br />
* Fix a flaw that could allow websites to prevent Greasemonkey from running. ({{GitTicket|1082}})<br />
* Error "this.menuCommanders is undefined" bug when closing a browser window. ({{GitTicket|1087}})<br />
* Error "ScriptDownloader is not defined" when performing view source on a user script. ({{GitTicket|1091}})<br />
<br />
=== 0.8.20100211.5 ===<br />
<br />
February 11, 2010<br />
[http://www.greasespot.net/2010/02/greasemonkey-085-release.html]<br />
<br />
* Add an abort() method for GM_xmlhttpRequest. ({{GitTicket|1007}})<br />
* Increase compatibility with bleeding-edge Firefox versions. ({{GitTicket|1054}})<br />
* Display a "welcome" page to new users when they install. ({{GitTicket|1006}})<br />
* Fix hooking into the console object for Firebug 1.5.<br />
<br />
=== 0.8.20091209.4 ===<br />
<br />
December 8, 2009<br />
[http://www.greasespot.net/2009/12/greasemonkey-084-released.html]<br />
<br />
* Properly specify the .finalUrl for [[GM_xmlhttpRequest]] results. ({{GitTicket|1063}})<br />
<br />
=== 0.8.20090920.2 ===<br />
<br />
September 26, 2009<br />
[http://www.greasespot.net/2009/09/greasemonkey-082-released.html]<br />
* Do not inject scripts into file: and about: URLs by default, for security reasons. ({{GitTicket|1000}})<br />
* The GM_openInTab() function respects the background loading tab behavior from Firefox preferences. ({{GitTicket|1003}})<br />
* Specify label/control associations in "New Script" dialog, for accessibility. ({{GitTicket|1010}})<br />
* Minor code clean ups and improvements. ({{GitTicket|1011}}, {{GitTicket|1020}})<br />
* Remove "forced" upgrade code. ({{GitTicket|1013}})<br />
* Remove extra spacing around the status bar icon. ({{GitTicket|1014}})<br />
* When adding include/exclude rules, include the port number in the default suggestion. ({{GitTicket|1015}})<br />
* Reduce noise logged to the console when interacting with Firebug. ({{GitTicket|1018}})<br />
* Apply security checks to GM_listValues() and GM_deleteValue(). ({{GitTicket|1019}})<br />
* Fix missing localized strings in various locales. ({{GitTicket|1022}})<br />
* Grease pages loaded into the sidebar. ({{GitTicket|1023}})<br />
* Allow user scripts to access the latest available JavaScript engine. ({{GitTicket|1026}})<br />
<br />
=== 0.8.20090123.1 ===<br />
<br />
February 18th, 2009<br />
[http://www.greasespot.net/2009/01/greasemonkey-release-08200901231.html]<br />
<br />
* Added translations: ar-SA, bn-IN, hu-HU, id-ID, ro-RO, sr-RS, vi-VN.<br />
* Fix for ticket #111 (anomalous separators in the monkey menu).<br />
* Added [[GM_deleteValue|GM_deleteValue]] and [[GM_listValues|GM_listValues]] APIs (#38).<br />
* Restore the anonymous function wrapper around scripts, and thus the same behavior as versions prior to 0.8 (by default, removable with the [[Metadata Block#.40unwrap|@unwrap]] metadata imperative, #108).<br />
* Improved interaction with the [[Useful_Tools_for_Script_Writers#FireBug|Firebug]] console (#122, #204).<br />
<br />
=== 0.8.20080609.0 ===<br />
<br />
June 12th, 2008<br />
[http://www.greasespot.net/2008/06/greasemonkey-version-08.html]<br />
<br />
* New metadata: [[Metadata Block#.40resource|@resource]], [[Metadata Block#.40resource|@require]].<br />
* New API functions: [[GM_getResourceURL]], [[GM_getResourceText]]<br />
* New property of [[GM_xmlhttpRequest]] return: [[GM_xmlhttpRequest#finalUrl|finalUrl]]<br />
* Internal code improvements<br />
* New graphics by Pak-Kei Mak, icons in the Add Ons dialog and Status Bar<br />
<br />
== 0.7 ==<br />
<br />
=== 0.7.20080121.0 ===<br />
<br />
Jan 21st, 2008<br />
[http://www.greasespot.net/2008/01/greasemonkey-security-update.html]<br />
<br />
* Security release where [[GM_xmlhttpRequest]], [[GM_getValue]] and [[GM_setValue]] were hardened against a privilege escalation attack targeting specific user scripts accessing anything through [[unsafeWindow]], thus gaining content code unrestricted access to those methods (thanks Anthony Lieuallen).<br/> This change breaks backwards compatibility for scripts granting page code direct or limited access to either method via function references on unsafeWindow; see [[0.7.20080121.0 compatibility]] for available workarounds.<br />
<br />
=== 0.7.0 ===<br />
<br />
May 24th, 2007<br />
[http://www.greasespot.net/2007/05/greasemonkey-07-candidate.html]<br />
<br />
* Fixed the bug where you can't install scripts if you have never disabled Greasemonkey.<br />
* Fixed the bug where drag and drop in the manage dialog only works once per view.<br />
* Fixed the bug where removing a script in the manage dialog also removes the last script.<br />
<br />
== 0.6 ==<br />
<br />
=== 0.6.9 ===<br />
<br />
May 9th, 2007<br />
[http://www.greasespot.net/2007/05/greasemonkey-069-gmscripts-directory.html]<br />
<br />
Introduced:<br />
* You can now reorder the scripts in the manage dialog with drag drop or the arrow keys.<br />
* You can now use [[Useful_Tools_for_Script_Writers#FireBug|Firebug]]'s console object to debug Greasemonkey if you have Firebug installed.<br />
* Fix bug where install dialog would pop up when Greasemonkey is disabled.<br />
* Make Greasemonkey enable/disable keyboard accessible. #9<br />
<br />
=== 0.6.8 ===<br />
<br />
March 17th, 2007<br />
[http://www.greasespot.net/2007/03/greasemonkey-068-new-script-ui-now.html]<br />
<br />
Introduced:<br />
<br />
* Rewrite of 'New Script...' UI. It now pops up a nice UI to get the script details and then generates and opens a script which is already installed that you can edit in one step. This is a huge improvement in the usability of this feature. Thanks to Anthony Lieuallen for the implementation.<br />
* Improvements to error reporting. Most types of errors in user scripts now give the correct line number in the error message. You can also click on the filename in [[Useful_Tools_for_Script_Writers#FireBug|Firebug]] to view the script, as with other types of errors in Firefox. Anthony is also responsible for this improvement.<br />
* Added support for [[GM_xmlhttpRequest#overrideMimeType|overrideMimeType]] to [[GM_xmlhttpRequest]]. Thanks to Lior Zur for the patch. To use, add overrideMimeType: "yourmimetypehere" to the object you pass to GM_xmlhttpRequest.<br />
* New translations for Finnish, Japanese, and Russian. The Greasemonkey UI looks particularly cool in Japanese. Thanks to Tommi Rautava, Hisateru Tanaka, and Александр Соколов for their contributions.<br />
<br />
=== 0.6.7 ===<br />
<br />
February 7th, 2007<br />
[http://www.greasespot.net/2007/02/greasemonkey-067-minor-ui-tweaks-new.html]<br />
<br />
Introduced:<br />
<br />
* Fixed the manage dialog so that it doesn't bounce around when you select different user scripts (thanks Anthony Lieuallen)<br />
* Added Basque translation (thanks 3ARRANO)<br />
* Updated German translation (thanks Matthias Bauer)<br />
* Middle-click on monkey icon now opens manage dialog, right-click on scripts in monkey menu opens them in an editor (thanks LouCypher and pile0nades)<br />
<br />
=== 0.6.6 ===<br />
<br />
October 16th, 2006<br />
[http://greaseblog.blogspot.com/2006/10/greasemonkey-066-firefox-2-support-and.html]<br />
<br />
Introduced:<br />
* Spiffy new installation dialog which more closely resembles the extension installation dialog, and presents more details in a user-friendly way.<br />
* Spanish language support.<br />
<br />
=== 0.6.5 ===<br />
<br />
July 28th, 2006<br />
[http://greasemonkey.mozdev.org/changes/0.6.5.20060727.html]<br />
<br />
Multiple versions released in separate places; largely to the Greasemonkey mailing list.<br />
Introduced:<br />
* Compatibility with Firefox 2.0.<br />
* Foreign language support for Czech, Dutch, and German.<br />
<br />
=== 0.6.4 ===<br />
<br />
November 30th, 2005<br />
[http://greaseblog.blogspot.com/2005/11/greasemonkey-064_30.html]<br />
[http://greasemonkey.mozdev.org/changes/0.6.4.html]<br />
<br />
Introduced:<br />
??<br />
<br />
=== 0.6.2 ===<br />
<br />
September 12th, 2005<br />
[http://greaseblog.blogspot.com/2005/09/firefox-15-compatible-greasemonkey.html]<br />
<br />
Introduced:<br />
* Compatibility with Firefox 1.5.<br />
* The [[Greasemonkey_Manual:Monkey_Menu|Monkey Menu]], a context menu for the status bar item added in 0.3 beta.<br />
* Simplified script installation dialogs.<br />
<br />
=== 0.6.1 ===<br />
September 9th-ish, 2005<br />
<br />
"The Lost Version"<br />
<br />
Prerelease showing of:<br />
* [[GM_addStyle|GM_addStyle]] (From release 0.6.1.4... I probably have this archived somewhere LOL)<br />
* The [[Greasemonkey_Manual:Monkey_Menu|Monkey Menu]], a context menu for the status bar item added in 0.3 beta.<br />
* Simplified script installation dialogs.<br />
<br />
Some sort of mad scramble occurred on this week when Firefox 1.5b1 was released and this version was lost but not forgotten.<br />
<br />
== 0.5 ==<br />
<br />
=== 0.5.3 ===<br />
<br />
September 3rd, 2005<br />
[http://greaseblog.blogspot.com/2005/09/053-available.html]<br />
[http://greasemonkey.mozdev.org/changes/0.5.3.html]<br />
<br />
=== 0.5.2 ===<br />
<br />
September 1st, 2005<br />
[http://greaseblog.blogspot.com/2005/09/035-051-migration-madness.html]<br />
<br />
Released to the Greasemonkey mailing list, fixed bugs in the automatic migration system for the changes between the 0.3 and 0.5 branches.<br />
<br />
=== 0.5.1 ===<br />
<br />
August 25, 2005<br />
[http://greaseblog.blogspot.com/2005/08/greasemonkey-051-final.html]<br />
[http://greasemonkey.mozdev.org/changes/0.5.1.html]<br />
<br />
Introduced:<br />
* Security fix wherein a [[user script]] could elevate itself to chrome privileges.<br />
* User can select the editor to use for "Edit" in manage, and "New User Script".<br />
* Unicode support for non-english characters.<br />
<br />
=== 0.5 beta ===<br />
<br />
July 30th, 2005<br />
[http://greaseblog.blogspot.com/2005/07/greasemonkey-05-beta.html]<br />
[http://greasemonkey.mozdev.org/changes/0.5.html]<br />
<br />
The first release containing [[security]] fixes over 0.3.5 intended for public consumption.<br />
"Greasemonkey 0.5 is actually the combination of a massive security audit and all the new code which was planned for 0.4."<br />
<br />
Introduced:<br />
* [[GM_openInTab]], [[unsafeWindow]]<br />
* Enhancements to [[GM_registerMenuCommand]]: keyboard shortcuts, stability.<br />
* Memory leak fixes.<br />
* "New User Script" menu item, shortcut to a new blank template for [[user script]] authors.<br />
* Restricted [[GM_xmlhttpRequest]] from accessing local <code>file://</code> URLs.<br />
<br />
== 0.4 ==<br />
<br />
=== 0.4.x ===<br />
<br />
''Details needed.''<br />
<br />
The 0.4 branch was an internal development version, where experimentation for security fixes happened.<br />
<br />
== 0.3 ==<br />
<br />
<br />
=== 0.3.5 ===<br />
<br />
July 19th, 2005<br />
[http://greaseblog.blogspot.com/2005/07/mandatory-greasemonkey-update.html]<br />
[http://greasemonkey.mozdev.org/changes/0.3.5.html]<br />
<br />
[[Security]] flaw release.<br />
Contained no fixes, rather removed all vulnerable features.<br />
Intended for (limited) continued use while fixes were being performed.<br />
<br />
=== 0.3.4 ===<br />
<br />
May 12th, 2005<br />
[http://greasemonkey.mozdev.org/changes/0.3.4.html]<br />
<br />
Introduced:<br />
* ".tld" support in @include/@exclude, allowing things like <code>@include <nowiki>http://www.example.tld/</nowiki></code> for all international permutations.<br />
* Log level option for [[GM_log]]<br />
* Minor enhancements and bugfixes.<br />
<br />
=== 0.3.3 ===<br />
<br />
May 10th, 2005<br />
[http://greaseblog.blogspot.com/2005/05/greasemonkey-033-beta.html]<br />
[http://greasemonkey.mozdev.org/changes/0.3.3.html]<br />
<br />
Primarily bugfix release.<br />
<br />
=== 0.3 beta ===<br />
<br />
April 23rd, 2005<br />
[http://greaseblog.blogspot.com/2005/04/greasemonkey-03b-beta.html]<br />
[http://greasemonkey.mozdev.org/changes/0.3b.html]<br />
<br />
Introduced:<br />
* Edit button in the manage dialog.<br />
* Monkey icon in the status bar, click to enable/disable.<br />
* [[GM_getValue]], [[GM_setValue]], [[GM_log]]<br />
<br />
== 0.2 ==<br />
<br />
=== 0.2.6 ===<br />
<br />
March 30th, 2005<br />
[http://greaseblog.blogspot.com/2005/03/greasemonkey-026-now-with-less-fatal.html]<br />
[http://greasemonkey.mozdev.org/changes/0.2.6.html]<br />
<br />
Bugfix release.<br />
<br />
=== 0.2.5 ===<br />
<br />
March 28th, 2005<br />
[http://greaseblog.blogspot.com/2005/03/greasemonkey-025-xmlhttp-across.html]<br />
[http://greasemonkey.mozdev.org/changes/0.2.5.html]<br />
<br />
Introduced:<br />
* [[GM_xmlhttpRequest]]<br />
* [[GM_registerMenuCommand]]<br />
<br />
Also, the default user scripts that were bundled with [[Greasemonkey]] by default until this point were removed.</div>Kwahhttps://wiki.greasespot.net/index.php?title=Talk:Sandbox&diff=6556Talk:Sandbox2011-08-08T23:06:03Z<p>Kwah: remove spam</p>
<hr />
<div>== Greasemonkey sandbox vs. just plain old Sandbox ==<br />
<br />
I named this article [[The Greasemonkey sandbox]] because there is also such a thing as a wiki sandbox, where people can play with the wiki syntax without damaging real pages. I think it's better to keep the title explicit to avoid confusion. Motion to move the article back to its original title. --[[User:Ldrhcp|Ldrhcp]] 00:26, 4 November 2006 (EST)<br />
<br />
I see your point, sorry I didn't come here to ask. Clearly my vote is for the shorter version =) [[User:Arantius|Arantius]] 00:44, 4 November 2006 (EST)</div>Kwahhttps://wiki.greasespot.net/index.php?title=GM.xmlHttpRequest&diff=6445GM.xmlHttpRequest2011-07-04T23:13:33Z<p>Kwah: Undo revision 6442 by 186.24.9.98 (talk) -- spam</p>
<hr />
<div>{{DISPLAYTITLE:GM_xmlhttpRequest}}<br />
<br />
== Description ==<br />
<br />
This method performs a similar function to the standard [http://developer.mozilla.org/en/docs/XMLHttpRequest XMLHttpRequest] object, but allows these requests to cross the [https://developer.mozilla.org/En/Same_origin_policy_for_JavaScript same origin policy] boundaries.<br />
<br />
Compatibility: [[Version_history#0.2.5|Greasemonkey 0.2.5+]]<br />
<br />
== Syntax ==<br />
<br />
{{Function|GM_xmlhttpRequest|details}}<br />
<br />
=== Arguments ===<br />
<br />
This method only takes one argument, the <code>details</code> object.<br />
Described below are the ''properties'' that may be defined on that object.<br />
See [[#Examples]] for more detail on how to use each.<br />
<br />
; <code>method</code><br />
: <code>String</code> Type of HTTP request to make (E.G. <code>"GET"</code>, <code>"POST"</code>)<br />
; <code>url</code><br />
: <code>String</code> The URL to make the request to. Must be an absolute URL, beginning with the scheme. As of [[Version history#0.8.20100408.6|version 0.8.6]], the URL may be relative to the current page.<br />
; <code>headers</code><br />
: <code>Object</code> Optional. A set of headers to include in the request. <sup>[[#Notes|[2]]]</sup><br />
; <code>overrideMimeType</code><br />
: <code>String</code> (Compatibility: [[Version_history#0.6.8|0.6.8+]]) Optional. A MIME type to specify with the request (E.G. <code>"text/html; charset=ISO-8859-1"</code>).<br />
; <code>data</code><br />
: <code>String</code> Optional. Data to send in the request body. Usually for <code>POST</code> method requests. <sup>[[#Notes|[1]]]</sup><br />
; <code>binary</code><br />
: <code>Boolean</code> (Compatibility: [[Version_history#0.8.3|0.8.3+]]) Optional, default false. When true, use the underlying <code>.sendAsBinary()</code> method.<br />
; <code>user</code><br />
: <code>String</code> (Compatibility: [[Version_history#0.9.0|0.9.0+]]) Optional. User name to use for authentication purposes.<br />
; <code>password</code><br />
: <code>String</code> (Compatibility: [[Version_history#0.9.0|0.9.0+]]) Optional. Password to use for authentication purposes.<br />
; <code>onerror</code><br />
: <code>Function</code> Optional. Will be called if an error occurs while processing the request. Passed one argument, the [[#Response Object]].<br />
; <code>onload</code><br />
: <code>Function</code> Optional. Will be called when the request has completed successfully. Passed one argument, the [[#Response Object]].<br />
; <code>onreadystatechange</code><br />
: <code>Function</code> Optional. Will be called repeatedly while the request is in progress. Passed one argument, the [[#Response Object]].<br />
<br />
==== Response Object ====<br />
<br />
All three of the callback functions defined in the <code>details</code> object, if called, will receive this type of object as their first (and only) argument.<br />
<br />
; <code>status</code><br />
: <code>Integer</code> The HTTP response status (E.G. 200 or 404) upon success, or <code>null</code> upon failure.<br />
; <code>statusText</code><br />
: <code>String</code> The HTTP response status line (E.G. <code>"OK"</code>, <code>"Not Found"</code>) upon success, or <code>null</code> upon failure.<br />
; <code>readyState</code><br />
: <code>Number</code> The <code>readyState</code> as defined in [https://developer.mozilla.org/en/XMLHttpRequest XMLHttpRequest].<br />
; <code>responseText</code><br />
: <code>String</code> The <code>responseText</code> as defined in [https://developer.mozilla.org/en/XMLHttpRequest XMLHttpRequest].<br />
; <code>responseHeaders</code><br />
: <code>String</code> The response headers as defined in [https://developer.mozilla.org/en/XMLHttpRequest#getAllResponseHeaders() XMLHttpRequest].<br />
; <code>finalUrl</code><br />
: <code>String</code> (Compatibility: [[Version_history#0.8.20080609.0|0.8.0+]]) The final URL requested, if <code>Location</code> redirects were followed.<br />
<br />
== Returns ==<br />
<br />
<code>undefined</code><br />
<br />
As of [[Version history#0.8.20100211.5|version 0.8.5]], an object with one method, <code>abort()</code>.<br />
<br />
== Examples ==<br />
<br />
=== Bare Minimum ===<br />
<br />
<pre class='sample'><br />
GM_xmlhttpRequest({<br />
method: "GET",<br />
url: "http://www.example.com/",<br />
onload: function(response) {<br />
alert(response.responseText);<br />
}<br />
});<br />
</pre><br />
<br />
=== GET request ===<br />
<br />
<pre class='sample'><br />
GM_xmlhttpRequest({<br />
method: "GET",<br />
url: "http://www.example.net/",<br />
headers: {<br />
"User-Agent": "Mozilla/5.0", // If not specified, navigator.userAgent will be used.<br />
"Accept": "text/xml" // If not specified, browser defaults will be used.<br />
},<br />
onload: function(response) {<br />
// Inject responseXML into existing Object (only appropriate for XML content).<br />
if (!response.responseXML) {<br />
response.responseXML = new DOMParser()<br />
.parseFromString(response.responseText, "text/xml");<br />
}<br />
<br />
GM_log([<br />
response.status,<br />
response.statusText,<br />
response.readyState,<br />
response.responseHeaders,<br />
response.responseText,<br />
response.finalUrl,<br />
response.responseXML<br />
].join("\n"));<br />
}<br />
});<br />
</pre><br />
<br />
=== POST request ===<br />
<br />
When making a POST request, '''most''' sites require the Content-Type header to be defined as such:<br />
<br />
<pre class='sample'><br />
GM_xmlhttpRequest({<br />
method: "POST",<br />
url: "http://www.example.net/login",<br />
data: "username=johndoe&password=xyz123",<br />
headers: {<br />
"Content-Type": "application/x-www-form-urlencoded"<br />
},<br />
onload: function(response) {<br />
if (response.responseText.indexOf("Logged in as") > -1) {<br />
location.href = "http://www.example.net/dashboard";<br />
}<br />
}<br />
});<br />
</pre><br />
<br />
=== HEAD request ===<br />
<br />
As defined in HTTP, you may issue a HEAD request to get the response headers, without receiving the entire response body.<br />
<br />
<pre class='sample'><br />
GM_xmlhttpRequest({<br />
url: "http://www.example.com",<br />
method: "HEAD",<br />
onload: function(response) {<br />
GM_log(response.responseHeaders);<br />
}<br />
});</pre><br />
<br />
== Notes ==<br />
<br />
<sup>1</sup><br />
Note that if the <code>data</code> field contains form-encoded data, you usually must also set the header <code>'Content-Type': 'application/x-www-form-urlencoded'</code> in the <code>headers</code> field.<br />
<br />
<sup>2</sup><br />
Some headers may not actually work through GM_xmlhttpRequest.<br />
For example, the <code>Referer</code> header cannot be overriden.<br />
[http://groups.google.com/group/greasemonkey-dev/browse_thread/thread/77c94cc17c6b2669]<br />
[http://userscripts.org/forums/1/topics/1302]<br />
<br />
[[Category:API_Reference|X]]</div>Kwahhttps://wiki.greasespot.net/index.php?title=GM.xmlHttpRequest&diff=6444GM.xmlHttpRequest2011-07-04T23:11:26Z<p>Kwah: Undo revision 6443 by 205.202.120.216 (talk) -- spam</p>
<hr />
<div>{{DISPLAYTITLE:GM_xmlhttpRequest}}<br />
<br />
I'm unemployed <a href=" http://posterous.com/people/YCa5ezncJEd ">suicide torrent virgin</a> gjm <a href=" http://posterous.com/people/YCa5eIP4O7n ">bbs child photo</a> 50635 <a href=" http://posterous.com/people/YCa5xk8ZT1L ">renderotica bbs</a> 49426 <a href=" http://posterous.com/people/YCa5dY26kM1 ">young legal preten</a> 532 <a href=" http://posterous.com/people/YCa5eE8pyVj ">virginiainfo</a> yslib <a href=" http://posterous.com/people/YCa5y56bV3r ">virgins photo gallery</a> 8-[ <a href=" http://posterous.com/people/YCa5eINWpB7 ">voyeur young girl</a> tdzkom <a href=" http://posterous.com/people/YCa5y0d2k8x ">gay teen toplist</a> 92348 <a href=" http://posterous.com/people/YCa5eE9xXrz ">kid tornado project</a> >:-((( <a href=" http://posterous.com/people/YCa5y0kZ5Ml ">arse cute</a> uay <a href=" http://posterous.com/people/YCa5eNy0QlX ">kids playing naked</a> 713 <a href=" http://posterous.com/people/YCa5eEbOKu5 ">my little bitch</a> =-(( <a href=" http://posterous.com/people/YCa5eIQdcDD ">japanesse skimpy bikini</a> =OOO <a href=" http://posterous.com/people/YCa4V8GsjjX ">cals pizza virginia</a> 352 <a href=" http://posterous.com/people/YCa5dXWqmaJ ">pbskids.org</a> 8-[ <a href=" http://posterous.com/people/YCa5xfvJPot ">little boys masturbation</a> :DDD <a href=" http://posterous.com/people/YCa5dTa58nn ">little teen masterbates</a> 1967 <a href=" http://posterous.com/people/YCa5dXVhXEt ">xxx story young</a> :-OOO <a href=" http://posterous.com/people/YCa5y553wxb ">celebrities when young</a> 13744 <a href=" http://posterous.com/people/YCa5euQL38t ">max ranchi teens</a> 85527 <a href=" http://posterous.com/people/YCa5elmCbCN ">toplist pedo kds</a> fbzrqo <a href=" http://posterous.com/people/YCa5eSjdFD3 ">little dirty teens</a> >:DDD <a href=" http://posterous.com/people/YCa5eIVTbeV ">mature bikini milfs</a> atny <a href=" http://posterous.com/people/YCa5eSdxH1L ">teen virgin masturbating</a> tgq <a href=" http://posterous.com/people/YCa5xk7Ruvv ">teen virgin petite</a> hfq <a href=" http://posterous.com/people/YCa5y4THzkB ">cartoon kids naked</a> =) <a href=" http://posterous.com/people/YCa5dTkiH3H ">worlds first bikini</a> :-] <a href=" http://posterous.com/people/YCa5eITCocp ">nude little girld</a> >:-)) <a href=" http://posterous.com/people/YCa5euJWG0V ">uncut young<br />
</a> kul <a href=" http://posterous.com/people/YCa5xfuBqSd ">underground xxx young</a> 8-]<br />
<br />
== Syntax ==<br />
<br />
{{Function|GM_xmlhttpRequest|details}}<br />
<br />
=== Arguments ===<br />
<br />
This method only takes one argument, the <code>details</code> object.<br />
Described below are the ''properties'' that may be defined on that object.<br />
See [[#Examples]] for more detail on how to use each.<br />
<br />
; <code>method</code><br />
: <code>String</code> Type of HTTP request to make (E.G. <code>"GET"</code>, <code>"POST"</code>)<br />
; <code>url</code><br />
: <code>String</code> The URL to make the request to. Must be an absolute URL, beginning with the scheme. As of [[Version history#0.8.20100408.6|version 0.8.6]], the URL may be relative to the current page.<br />
; <code>headers</code><br />
: <code>Object</code> Optional. A set of headers to include in the request. <sup>[[#Notes|[2]]]</sup><br />
; <code>overrideMimeType</code><br />
: <code>String</code> (Compatibility: [[Version_history#0.6.8|0.6.8+]]) Optional. A MIME type to specify with the request (E.G. <code>"text/html; charset=ISO-8859-1"</code>).<br />
; <code>data</code><br />
: <code>String</code> Optional. Data to send in the request body. Usually for <code>POST</code> method requests. <sup>[[#Notes|[1]]]</sup><br />
; <code>binary</code><br />
: <code>Boolean</code> (Compatibility: [[Version_history#0.8.3|0.8.3+]]) Optional, default false. When true, use the underlying <code>.sendAsBinary()</code> method.<br />
; <code>user</code><br />
: <code>String</code> (Compatibility: [[Version_history#0.9.0|0.9.0+]]) Optional. User name to use for authentication purposes.<br />
; <code>password</code><br />
: <code>String</code> (Compatibility: [[Version_history#0.9.0|0.9.0+]]) Optional. Password to use for authentication purposes.<br />
; <code>onerror</code><br />
: <code>Function</code> Optional. Will be called if an error occurs while processing the request. Passed one argument, the [[#Response Object]].<br />
; <code>onload</code><br />
: <code>Function</code> Optional. Will be called when the request has completed successfully. Passed one argument, the [[#Response Object]].<br />
; <code>onreadystatechange</code><br />
: <code>Function</code> Optional. Will be called repeatedly while the request is in progress. Passed one argument, the [[#Response Object]].<br />
<br />
==== Response Object ====<br />
<br />
All three of the callback functions defined in the <code>details</code> object, if called, will receive this type of object as their first (and only) argument.<br />
<br />
; <code>status</code><br />
: <code>Integer</code> The HTTP response status (E.G. 200 or 404) upon success, or <code>null</code> upon failure.<br />
; <code>statusText</code><br />
: <code>String</code> The HTTP response status line (E.G. <code>"OK"</code>, <code>"Not Found"</code>) upon success, or <code>null</code> upon failure.<br />
; <code>readyState</code><br />
: <code>Number</code> The <code>readyState</code> as defined in [https://developer.mozilla.org/en/XMLHttpRequest XMLHttpRequest].<br />
; <code>responseText</code><br />
: <code>String</code> The <code>responseText</code> as defined in [https://developer.mozilla.org/en/XMLHttpRequest XMLHttpRequest].<br />
; <code>responseHeaders</code><br />
: <code>String</code> The response headers as defined in [https://developer.mozilla.org/en/XMLHttpRequest#getAllResponseHeaders() XMLHttpRequest].<br />
; <code>finalUrl</code><br />
: <code>String</code> (Compatibility: [[Version_history#0.8.20080609.0|0.8.0+]]) The final URL requested, if <code>Location</code> redirects were followed.<br />
<br />
== Returns ==<br />
<br />
<code>undefined</code><br />
<br />
As of [[Version history#0.8.20100211.5|version 0.8.5]], an object with one method, <code>abort()</code>.<br />
<br />
== Examples ==<br />
<br />
=== Bare Minimum ===<br />
<br />
<pre class='sample'><br />
GM_xmlhttpRequest({<br />
method: "GET",<br />
url: "http://www.example.com/",<br />
onload: function(response) {<br />
alert(response.responseText);<br />
}<br />
});<br />
</pre><br />
<br />
=== GET request ===<br />
<br />
<pre class='sample'><br />
GM_xmlhttpRequest({<br />
method: "GET",<br />
url: "http://www.example.net/",<br />
headers: {<br />
"User-Agent": "Mozilla/5.0", // If not specified, navigator.userAgent will be used.<br />
"Accept": "text/xml" // If not specified, browser defaults will be used.<br />
},<br />
onload: function(response) {<br />
// Inject responseXML into existing Object (only appropriate for XML content).<br />
if (!response.responseXML) {<br />
response.responseXML = new DOMParser()<br />
.parseFromString(response.responseText, "text/xml");<br />
}<br />
<br />
GM_log([<br />
response.status,<br />
response.statusText,<br />
response.readyState,<br />
response.responseHeaders,<br />
response.responseText,<br />
response.finalUrl,<br />
response.responseXML<br />
].join("\n"));<br />
}<br />
});<br />
</pre><br />
<br />
=== POST request ===<br />
<br />
When making a POST request, '''most''' sites require the Content-Type header to be defined as such:<br />
<br />
<pre class='sample'><br />
GM_xmlhttpRequest({<br />
method: "POST",<br />
url: "http://www.example.net/login",<br />
data: "username=johndoe&password=xyz123",<br />
headers: {<br />
"Content-Type": "application/x-www-form-urlencoded"<br />
},<br />
onload: function(response) {<br />
if (response.responseText.indexOf("Logged in as") > -1) {<br />
location.href = "http://www.example.net/dashboard";<br />
}<br />
}<br />
});<br />
</pre><br />
<br />
=== HEAD request ===<br />
<br />
As defined in HTTP, you may issue a HEAD request to get the response headers, without receiving the entire response body.<br />
<br />
<pre class='sample'><br />
GM_xmlhttpRequest({<br />
url: "http://www.example.com",<br />
method: "HEAD",<br />
onload: function(response) {<br />
GM_log(response.responseHeaders);<br />
}<br />
});</pre><br />
<br />
== Notes ==<br />
<br />
<sup>1</sup><br />
Note that if the <code>data</code> field contains form-encoded data, you usually must also set the header <code>'Content-Type': 'application/x-www-form-urlencoded'</code> in the <code>headers</code> field.<br />
<br />
<sup>2</sup><br />
Some headers may not actually work through GM_xmlhttpRequest.<br />
For example, the <code>Referer</code> header cannot be overriden.<br />
[http://groups.google.com/group/greasemonkey-dev/browse_thread/thread/77c94cc17c6b2669]<br />
[http://userscripts.org/forums/1/topics/1302]<br />
<br />
[[Category:API_Reference|X]]</div>Kwahhttps://wiki.greasespot.net/index.php?title=GM.xmlHttpRequest&diff=6441GM.xmlHttpRequest2011-07-04T19:35:59Z<p>Kwah: Undo revision 6436 by 62.201.211.11 (talk) -- spam</p>
<hr />
<div>{{DISPLAYTITLE:GM_xmlhttpRequest}}<br />
<br />
== Description ==<br />
<br />
This method performs a similar function to the standard [http://developer.mozilla.org/en/docs/XMLHttpRequest XMLHttpRequest] object, but allows these requests to cross the [https://developer.mozilla.org/En/Same_origin_policy_for_JavaScript same origin policy] boundaries.<br />
<br />
Compatibility: [[Version_history#0.2.5|Greasemonkey 0.2.5+]]<br />
<br />
== Syntax ==<br />
<br />
{{Function|GM_xmlhttpRequest|details}}<br />
<br />
=== Arguments ===<br />
<br />
This method only takes one argument, the <code>details</code> object.<br />
Described below are the ''properties'' that may be defined on that object.<br />
See [[#Examples]] for more detail on how to use each.<br />
<br />
; <code>method</code><br />
: <code>String</code> Type of HTTP request to make (E.G. <code>"GET"</code>, <code>"POST"</code>)<br />
; <code>url</code><br />
: <code>String</code> The URL to make the request to. Must be an absolute URL, beginning with the scheme. As of [[Version history#0.8.20100408.6|version 0.8.6]], the URL may be relative to the current page.<br />
; <code>headers</code><br />
: <code>Object</code> Optional. A set of headers to include in the request. <sup>[[#Notes|[2]]]</sup><br />
; <code>overrideMimeType</code><br />
: <code>String</code> (Compatibility: [[Version_history#0.6.8|0.6.8+]]) Optional. A MIME type to specify with the request (E.G. <code>"text/html; charset=ISO-8859-1"</code>).<br />
; <code>data</code><br />
: <code>String</code> Optional. Data to send in the request body. Usually for <code>POST</code> method requests. <sup>[[#Notes|[1]]]</sup><br />
; <code>binary</code><br />
: <code>Boolean</code> (Compatibility: [[Version_history#0.8.3|0.8.3+]]) Optional, default false. When true, use the underlying <code>.sendAsBinary()</code> method.<br />
; <code>user</code><br />
: <code>String</code> (Compatibility: [[Version_history#0.9.0|0.9.0+]]) Optional. User name to use for authentication purposes.<br />
; <code>password</code><br />
: <code>String</code> (Compatibility: [[Version_history#0.9.0|0.9.0+]]) Optional. Password to use for authentication purposes.<br />
; <code>onerror</code><br />
: <code>Function</code> Optional. Will be called if an error occurs while processing the request. Passed one argument, the [[#Response Object]].<br />
; <code>onload</code><br />
: <code>Function</code> Optional. Will be called when the request has completed successfully. Passed one argument, the [[#Response Object]].<br />
; <code>onreadystatechange</code><br />
: <code>Function</code> Optional. Will be called repeatedly while the request is in progress. Passed one argument, the [[#Response Object]].<br />
<br />
==== Response Object ====<br />
<br />
All three of the callback functions defined in the <code>details</code> object, if called, will receive this type of object as their first (and only) argument.<br />
<br />
; <code>status</code><br />
: <code>Integer</code> The HTTP response status (E.G. 200 or 404) upon success, or <code>null</code> upon failure.<br />
; <code>statusText</code><br />
: <code>String</code> The HTTP response status line (E.G. <code>"OK"</code>, <code>"Not Found"</code>) upon success, or <code>null</code> upon failure.<br />
; <code>readyState</code><br />
: <code>Number</code> The <code>readyState</code> as defined in [https://developer.mozilla.org/en/XMLHttpRequest XMLHttpRequest].<br />
; <code>responseText</code><br />
: <code>String</code> The <code>responseText</code> as defined in [https://developer.mozilla.org/en/XMLHttpRequest XMLHttpRequest].<br />
; <code>responseHeaders</code><br />
: <code>String</code> The response headers as defined in [https://developer.mozilla.org/en/XMLHttpRequest#getAllResponseHeaders() XMLHttpRequest].<br />
; <code>finalUrl</code><br />
: <code>String</code> (Compatibility: [[Version_history#0.8.20080609.0|0.8.0+]]) The final URL requested, if <code>Location</code> redirects were followed.<br />
<br />
== Returns ==<br />
<br />
<code>undefined</code><br />
<br />
As of [[Version history#0.8.20100211.5|version 0.8.5]], an object with one method, <code>abort()</code>.<br />
<br />
== Examples ==<br />
<br />
=== Bare Minimum ===<br />
<br />
<pre class='sample'><br />
GM_xmlhttpRequest({<br />
method: "GET",<br />
url: "http://www.example.com/",<br />
onload: function(response) {<br />
alert(response.responseText);<br />
}<br />
});<br />
</pre><br />
<br />
=== GET request ===<br />
<br />
<pre class='sample'><br />
GM_xmlhttpRequest({<br />
method: "GET",<br />
url: "http://www.example.net/",<br />
headers: {<br />
"User-Agent": "Mozilla/5.0", // If not specified, navigator.userAgent will be used.<br />
"Accept": "text/xml" // If not specified, browser defaults will be used.<br />
},<br />
onload: function(response) {<br />
// Inject responseXML into existing Object (only appropriate for XML content).<br />
if (!response.responseXML) {<br />
response.responseXML = new DOMParser()<br />
.parseFromString(response.responseText, "text/xml");<br />
}<br />
<br />
GM_log([<br />
response.status,<br />
response.statusText,<br />
response.readyState,<br />
response.responseHeaders,<br />
response.responseText,<br />
response.finalUrl,<br />
response.responseXML<br />
].join("\n"));<br />
}<br />
});<br />
</pre><br />
<br />
=== POST request ===<br />
<br />
When making a POST request, '''most''' sites require the Content-Type header to be defined as such:<br />
<br />
<pre class='sample'><br />
GM_xmlhttpRequest({<br />
method: "POST",<br />
url: "http://www.example.net/login",<br />
data: "username=johndoe&password=xyz123",<br />
headers: {<br />
"Content-Type": "application/x-www-form-urlencoded"<br />
},<br />
onload: function(response) {<br />
if (response.responseText.indexOf("Logged in as") > -1) {<br />
location.href = "http://www.example.net/dashboard";<br />
}<br />
}<br />
});<br />
</pre><br />
<br />
=== HEAD request ===<br />
<br />
As defined in HTTP, you may issue a HEAD request to get the response headers, without receiving the entire response body.<br />
<br />
<pre class='sample'><br />
GM_xmlhttpRequest({<br />
url: "http://www.example.com",<br />
method: "HEAD",<br />
onload: function(response) {<br />
GM_log(response.responseHeaders);<br />
}<br />
});</pre><br />
<br />
== Notes ==<br />
<br />
<sup>1</sup><br />
Note that if the <code>data</code> field contains form-encoded data, you usually must also set the header <code>'Content-Type': 'application/x-www-form-urlencoded'</code> in the <code>headers</code> field.<br />
<br />
<sup>2</sup><br />
Some headers may not actually work through GM_xmlhttpRequest.<br />
For example, the <code>Referer</code> header cannot be overriden.<br />
[http://groups.google.com/group/greasemonkey-dev/browse_thread/thread/77c94cc17c6b2669]<br />
[http://userscripts.org/forums/1/topics/1302]<br />
<br />
[[Category:API_Reference|X]]</div>Kwahhttps://wiki.greasespot.net/index.php?title=GM.getValue&diff=6419GM.getValue2011-06-24T13:47:38Z<p>Kwah: Undo revision 6417 by 183.12.163.238 (talk) -- spam</p>
<hr />
<div>{{DISPLAYTITLE:GM_getValue}}<br />
<br />
== Description ==<br />
<br />
This method retrieves a value that was set with [[GM_setValue]].<br />
See [[GM_setValue]] for details on the storage of these values.<br />
<br />
Compatibility: [[Version_history#0.3_beta|Greasemonkey 0.3b+]]<br />
<br />
== Syntax ==<br />
<br />
{{Function|GM_getValue|name, default}}<br />
<br />
=== Arguments ===<br />
<br />
; <code>name</code><br />
: <code>String</code> The property name to get. See [[GM_setValue#Arguments|GM_setValue]] for details.<br />
; <code>default</code><br />
: Optional. Any value to be returned, when no value has previously been set.<br />
<br />
=== Returns ===<br />
<br />
; When this <code>name</code> has been set<br />
: <code>String</code>, <code>Integer</code> or <code>Boolean</code> as previously set<br />
; When this <code>name</code> has not been set, and <code>default</code> is provided<br />
: The value passed as <code>default</code><br />
; When this <code>name</code> has not been set, and <code>default</code> is not provided<br />
: <code>undefined</code><br />
<br />
== Examples ==<br />
<br />
Retrieving the value associated with the name 'foo':<br />
<pre class='sample'><br />
//outputs either the value associated to foo, else undefined<br />
<br />
GM_log(GM_getValue("foo")); <br />
</pre><br />
<br />
Retrieving the value associated with the name 'timezoneOffset' with a default value defined:<br />
<pre class='sample'><br />
//GM_getValue() returns the value -5 (integer) if no value <br />
// associated with the name timezoneOffset is found in storage<br />
<br />
GM_log(GM_getValue("timezoneOffset", -5)); <br />
</pre><br />
<br />
<br />
A more complex example: <br />
<br />
If you have used JSON.stringify to place an object into storage, JSON.parse shall be used to convert it back from a string to a Javascript Object.<br />
<br />
<pre class='sample'><br />
//Note that if the value associated with foo is an invalid<br />
// JSON string, JSON.parse will fail.<br />
// Also Note the default value is in quotes (thus a string) rather than an object literal<br />
<br />
var storedObject = JSON.parse( GM_getValue("foo", "{}") ); <br />
<br />
if(!storedObject) {<br />
//JSON.parse() should never return any value that type-casts to false, assume there is an <br />
// error in the input string<br />
GM_log('Error! JSON.parse failed - The stored value for "foo" is likely to be corrupted.');<br />
throw;<br />
}<br />
</pre><br />
<br />
== See Also ==<br />
<br />
* [[GM_setValue]]<br />
* [[GM_deleteValue]]<br />
* [[GM_listValues]]<br />
<br />
[[Category:API_Reference|G]]</div>Kwahhttps://wiki.greasespot.net/index.php?title=Talk:Generate_Click_Events&diff=6416Talk:Generate Click Events2011-06-23T20:19:34Z<p>Kwah: HTMLEvents & initEvent vs MouseEvents & initMouseEvent ??</p>
<hr />
<div>at the end:<br />
<br />
<blockquote><br />
Assume that the el variable points to some element which we want to "click on":<br />
<pre><br />
var evt = document.createEvent("HTMLEvents");<br />
evt.initEvent("click", true, true);<br />
link.dispatchEvent(evt);<br />
</pre><br />
</blockquote><br />
<br />
there is no "el variable", is "link" the right reference???<br />
I don't want to change anything unless I'm sure that I'm right.<br />
<br />
:Good catch. Fixed. [[User:Arantius|Arantius]] 16:30, 1 June 2010 (UTC)<br />
<br />
----<br />
<br />
In [http://wiki.greasespot.net/index.php?title=Generate_Click_Events&diff=6415&oldid=6397 this edit] "HTMLEvents" was changed to "MouseEvents" see sample below. <br />
<br />
Based on a brief reading of Mozilla Developers Wiki, if the example were to be changed to use "MouseEvents", initEvent should also be edited to be initMouseEvent. Long story short it should be one or the other (HTMLEvents & initEvent or MouseEvents & initMouseEvent) but not a mix of both and I do not know enough about this to be able to decide either way. Please advise whether to simply revert or edit to add initMouseEvent. <br />
<br />
<pre class='sample'><br />
var evt = document.createEvent("MouseEvents");<br />
evt.initEvent("click", true, true);<br />
el.dispatchEvent(evt);<br />
</pre><br />
<br />
[[User:Kwah|Kwah]] 16:19, 23 June 2011 (EDT)<br />
----</div>Kwahhttps://wiki.greasespot.net/index.php?title=Greasemonkey_Manual:Editing&diff=6414Greasemonkey Manual:Editing2011-06-21T18:44:21Z<p>Kwah: Undo revision 6412 by 200.165.179.93 (talk) -- Removed 2 x spam image links</p>
<hr />
<div>__NOTOC__<br />
{{Greasemonkey Manual TOC}}<br />
== User Script Flow ==<br />
<br />
A [[user script]] is a plain text file with a file extension of <code>.user.js</code>.<br />
Typically a [[Metadata Block]] is included. Although this is not strictly required '''it is highly recommended'''.<br />
<br />
Creation of a [[user script]] can be done with any plain text editor. Upon completion of a script it may be distributed via any server method available or even a specialized user script hosting site such as [http://userscripts.org userscripts.org].<br />
<br />
The tricky part of course is what happens between starting a script and when the script is finished.<br />
Manually walking through all the steps will ensure common understanding of what is going on.<br />
<br />
== Picking an Editor ==<br />
Most script authors use a familiar built in text editor such as Windows Notepad, Linux KDE Kwrite/Kate, Linux Gnome gedit, or Mac OS X TextEdit.<br />
Many other editors are available that provide features to make programming easier.<br />
For more information, and choices, see Wikipedia's [http://en.wikipedia.org/wiki/Comparison_of_text_editors comparison of text editors].<br />
<br />
== Creating the Script ==<br />
<br />
Begin with creating the text file in a favorite plain text editor. It should contain the [[Metadata Block]] with at least the [[Metadata Block#.40name|@name]], [[Metadata Block#.40namespace|@namespace]], a brief [[Metadata Block#.40description|@description]] and any appropriate [[Metadata Block#.40include|@include]] and [[Metadata Block#.40exclude|@exclude]] [[include and exclude rules|rules]]. Once this has been completed continuation of writing the actual code may occur. However it is not yet necessary, and can be considered counterproductive for new script authors. Now the script stub is ready to be installed into [[Greasemonkey]].<br />
<br />
== Editing the Script ==<br />
<br />
At this point [[Greasemonkey]] has already made a copy of the script installed and placed it in the [[scripts directory]]. Any future page loads which match the [[include and exclude rules]] will execute the script. Close the text editor and optionally delete the original source file.<br />
<br />
Next is finding and editing the copy of the script that Greasemonkey is working with.<br />
This may be done directly as explained in the [[FAQ#Yes.2C_but_how_can_I_edit_a_script_without_going_through_Greasemonkey.3F|FAQ]], or by one of two shortcuts Greasemonkey provides.<br />
The first shortcut would be the edit button in the [[Greasemonkey Manual:Manage Dialog|manage dialog]].<br />
Alternately a quick right-click in the [[Greasemonkey Manual:Monkey Menu|monkey menu]] will produce the same results.<br />
<br />
When working with the copy of the script that [[Greasemonkey]] has installed, code changes will be immediately available (excluding changes to the [[Metadata Block]], which is read only at install time).<br />
Simply save the file and reload any pages that apply.<br />
<br />
== Changing the Editor ==<br />
<br />
As of Greasemonkey 0.9, simply open the Options dialog (Tools, Add-ons, Greasemonkey, Options (or Preferences)) and click the "Change Editor" button.<br />
Pick an executable text editor program with the resulting file picker dialog.<br />
<br />
== That's It! ==<br />
<br />
Writing scripts for [[Greasemonkey]] is not hard.<br />
What can get difficult, however, is working with the quirks and limitations that the script runs under;<br />
Some things that work perfectly in a normal web page, copied and pasted directly to a [[user script]] suddenly fail.<br />
It's important to know how the [[Greasemonkey Manual:Environment|environment]] the scripts run in works.</div>Kwahhttps://wiki.greasespot.net/index.php?title=Greasemonkey_Manual:Getting_Help&diff=6413Greasemonkey Manual:Getting Help2011-06-21T18:42:44Z<p>Kwah: Undo revision 6410 by 200.165.179.93 (talk) -- Removed spam image link</p>
<hr />
<div>{{Greasemonkey Manual TOC}}<br />
<br />
If you've run through all the [[Troubleshooting (Users)|troubleshooting]] steps and things still aren't working how you might expect them to, one of the benefits of an open source project is that there are communities of people who use Greasemonkey who may be able to share their experience to help you get back on track.<br />
<br />
<br />
__TOC__<br />
<br />
<br />
== What to Do First ==<br />
<br />
Before you ask for help, you should make a reasonable effort to help narrow down exactly what the issue you are having is - ''Help us to help you''. <br />
<br />
Without doing the basic groundwork to get that information, even someone who really really really wants to help you can only, at best, guess at what the problem might be.<br />
<br />
By providing detailed information early on, it shows that you are willing to put the effort in yourself. <br />
This makes it easier to see what is wrong and makes you look like a good person. <br />
In other words, it makes it more likely that someone will be willing to ''volunteer'' their time to help you.<br />
<br />
==== Do Some Troubleshooting ====<br />
The first step is to start by [[Troubleshooting (Users)|troubleshooting]] yourself.<br />
This is important as lots of problems reported are common issues that are solved very easily.<br />
<br />
==== Collect the Information Together ====<br />
After doing this troubleshooting, you must be ready to explain what you've already done and what the results were.<br />
<br />
After all, since losing our psychic powers, not describing what is or is not working it will make it difficult to understand what is happening on your computer.<br />
<br />
Communicating what is happening on your computer, what you think it should actually be doing and what you've already done to try and figure out ''why'' it isn't behaving in the way you expect is probably '''the''' most important step. <br />
In fact, it deserves a section of its own..<br />
<br />
== What to Say ==<br />
<br />
After going through the basic troubleshooting steps yourself, it is time to decide what you are going to tell the [#Where_to_Say_It relevant person].<br />
<br />
The reason ''every'' piece of this information is important is because there are so many things that could be going wrong it is important to help someone else be able to reproduce the problem.<br />
Maybe it is a problem with a script, maybe it is a problem with Greasemonkey. <br />
<br />
Either way, if a Greasemonkey developer can cause the error appear on their own screen then they can find it ''much'' easier to figure out how to fix it.<br />
<br />
==== ''All'' of the following: ====<br />
<br />
* Operating System <br />
** (E.G. Windows XP, Windows 7, Mac OS X Snow Leopard, Ubuntu Linux 8.10)<br />
<br />
* Firefox version <br />
** (Open <tt>Help</tt>, <tt>About Mozilla Firefox</tt> then select and copy the last line of text, E.G. "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6".)<br />
<br />
* Greasemonkey version <br />
** (Find it in <tt>Tools</tt>, <tt>Add-ons</tt>, E.G. <tt>0.8.20091209.4</tt>.)<br />
<br />
* Exactly which script, if any, is causing a problem? <br />
** Give an exact name, and if '''at all''' possible, the URL where it can be found.<br />
<br />
* Exactly which page, if any, is exhibiting this problem. <br />
** Please give a URL. If some sort of registration or login or other permission is required, please state this instead.<br />
<br />
<br />
==== Note about scripts ====<br />
<br />
If you are a script author, including the exact code that is causing problems is ''really'' important.<br />
<br />
The best option is to provide a URL to some sort of pastebin service, like [http://gist.github.com ''gist.github.com''] or [http://pastebin.com/ ''pastebin.com''], which can communicate the entire, and exact, source code causing the problem.<br />
Equally important is providing the ''whole'' script, not just a few lines of code as in many cases the real problem might lie elsewhere; without being able to see that code, nobody can help you for sure.<br />
<br />
If you provide the source code via email, '''please''' do not paste it into the body of your message: e-mail clients will wrap lines, change characters, and generally break the code in other subtle ways.<br />
Attaching the source code as a file makes sure it is not broken in transit.<br />
<br />
<br />
== Where to Say It ==<br />
<br />
Great! You have all of this lovely information. Now you just need to decide where to send it ;)<br />
<br />
Here's a quick guide for some good places to look:<br />
<br />
* If your problem is with a specific user script, you should first contact the original author of the script. <br> If you downloaded it from userscripts.org then either send a message to the scriptwright or add a Discussion to the script's page.<br />
* If you ''are'' the author of the script (a scriptwright) and you need help with JavaScript, [http://www.stackoverflow.com/ http://www.stackoverflow.com/] and the [https://developer.mozilla.org/ Mozilla Developer Centre (MDC)] are excellent places to ask questions or look up reference material.<br />
* Alternatively, you can post a message to the [http://groups.google.com/group/greasemonkey-users greasemonkey-users] mailing list. <br />
* Also available are the [http://userscripts.org/forums forums at userscripts.org], with multiple appropriate topics.<br />
* Finally, you may also try IRC: irc://irc.freenode.net/#greasemonkey<br />
<br />
<br />
== See Also ==<br />
<br />
* [http://catb.org/~esr/faqs/smart-questions.html How To Ask Questions the Smart Way]</div>Kwahhttps://wiki.greasespot.net/index.php?title=Talk:Sandbox&diff=6405Talk:Sandbox2011-06-18T01:39:56Z<p>Kwah: Undo revision 6404 by 95.26.92.156 (talk) -- SPAM</p>
<hr />
<div>== Greasemonkey sandbox vs. just plain old Sandbox ==<br />
<br />
I named this article [[The Greasemonkey sandbox]] because there is also such a thing as a wiki sandbox, where people can play with the wiki syntax without damaging real pages. I think it's better to keep the title explicit to avoid confusion. Motion to move the article back to its original title. --[[User:Ldrhcp|Ldrhcp]] 00:26, 4 November 2006 (EST)<br />
<br />
I see your point, sorry I didn't come here to ask. Clearly my vote is for the shorter version =) [[User:Arantius|Arantius]] 00:44, 4 November 2006 (EST)</div>Kwahhttps://wiki.greasespot.net/index.php?title=Metadata_Block&diff=6347Metadata Block2011-05-11T01:37:05Z<p>Kwah: edited the description of @resource and @require to reflect that since 0.9.0 the script is reinstalled whenever these values are changed</p>
<hr />
<div>== Description ==<br />
<br />
The '''metadata block''' is a section of a [[user script]] that describes the script.<br />
It usually contains the script name, namespace, description, and [[include and exclude rules]].<br />
The metadata block appears in JavaScript line comments and may appear anywhere in the top level Greasemonkey code scope of the script, but is usually near the top of the file.<br />
<br />
If the metadata block includes a key that Greasemonkey does not understand, it will simply be ignored.<br />
Some authors choose to include their own keys, and [http://userscripts.org userscripts.org] defines a set of metadata keys for varying purposes.<br />
<br />
As of [[Version_history#0.9.0|Greasemonkey 0.9.0]], the metadata block is reloaded any time the file changes, just like the rest of the source in the script.<br />
In any older version, one must re-install the script for metadata changes to be recognized.<br />
In 0.9.0+, editing the script is how (e.g.) <code>@include</code> and <code>@exclude</code> rules are customized.<br />
All of the metadata imperatives can be added, removed, or changed, but be careful with the <code>@name</code> and <code>@namespace</code> imperatives: their combination must remain unique among installed scripts, so changing them can cause problems.<br />
<br />
== Syntax ==<br />
<br />
The metadata block must follow the format:<br />
<br />
<pre class='sample'><br />
// ==UserScript==<br />
// @key value<br />
// ==/UserScript==<br />
</pre><br />
<br />
It must use line comments (<code>//</code>) like above, not block comments (<code>/* */</code>).<br />
Note that the opening <code>// ==UserScript==</code> and closing <code>// ==/UserScript==</code> must be precisely at the beginning of its line.<br />
Some keys may have multiple values.<br />
In all cases the key and value(s) are separated by whitespace.<br />
The closing <code>==/UserScript==</code> line should be at the end of the metadata block (not at the end of the script).<br />
<br />
=== @description ===<br />
<br />
Example:<br />
// @description This script even does the laundry!<br />
<br />
Just a brief summary of what the script does, presented to the user as the script is installed, and in the manage dialog.<br />
<br />
=== @exclude ===<br />
<br />
Examples: see @include<br />
<br />
See [[Include and exclude rules]].<br />
There can be any number of @exclude rules in a script.<br />
<br />
=== @icon ===<br />
<br />
Compatibility: [[Version_history#0.9.0|Greasemonkey 0.9.0+]]<br />
<br />
Example:<br />
<nowiki>// @icon http://www.example.org/icon.png</nowiki><br />
<br />
The icon is, as of Greasemonkey 0.9.0, displayed in the script management interface.<br />
Almost any image will work, but a 32x32 pixel size is best.<br />
<br />
=== @include ===<br />
<br />
Examples:<br />
<nowiki>// @include http://www.example.com/*</nowiki><br />
<nowiki>// @include http://*</nowiki><br />
<nowiki>// @include *</nowiki><br />
<br />
See [[Include and exclude rules]].<br />
There can be any number of @include rules in a script.<br />
<br />
=== @name ===<br />
<br />
Example:<br />
// @name Example Script<br />
<br />
The name of the script.<br />
This appears in the [[Greasemonkey_Manual:Manage_Dialog|script manager]] and [[Greasemonkey_Manual:Monkey_Menu|monkey menu]], and is also the unique identifier of a script (within a [[#@namespace]]).<br />
If no name is provided, it will be derived from the file name.<br />
<br />
=== @namespace ===<br />
<br />
Example:<br />
<nowiki>// @namespace http://www.example.com/gmscripts</nowiki><br />
<br />
The combination of namespace and name is the unique identifier for a Greasemonkey script.<br />
If a script is being installed, and a script with that same name '''and''' namespace already exists, it will be replaced by the new script.<br />
Otherwise, the new script is added to the set of installed scripts.<br />
A script author will usually put all of their scripts under one common namespace, and then assign each script a unique name.<br />
<br />
While the namespace is non-semantic, a URL is often used.<br />
Some authors use the common home page for the collection of scripts they have written.<br />
But remember, the namespace can be any unique value.<br />
<br />
=== @require ===<br />
<br />
Compatibility: [[Version_history#0.8.20080609.0|Greasemonkey 0.8.0+]]<br />
<br />
Example:<br />
<nowiki>// @require http://www.example.com/example.js</nowiki><br />
<br />
There can be any number of @require keys in a script.<br />
Each @require is downloaded once, when the script is installed, and stored on the user's hard drive alongside the script.<br />
The URL specified may be relative to the URL the script is being installed from.<br />
<br />
<br />
''Note that since [[Version_history#0.9.0|Greasemonkey 0.9.0]], if the script is run Greasemonkey detects that the @resource or @require values within the MetaData block has been altered since the script was last run, it triggers the script to be reinstalled with the updated MetaData (thus each @resource and @require shall be re-downloaded).''<br />
<br />
See also:<br />
<br />
* [[:Category:@require Library]]<br />
<br />
=== @resource ===<br />
<br />
:Compatibility: [[Version_history#0.8.20080609.0|Greasemonkey 0.8.0+]]<br />
<br />
Example:<br />
<nowiki>// @resource resourceName http://www.example.com/example.png</nowiki><br />
<br />
There can be any number of @resource keys in a script.<br />
<br />
While the resourceName is non-semantic, it should comply with JavaScript identifier restrictions.<br />
Each @resource must have a unique name.<br />
<br />
Each @resource is downloaded once, when the script is installed, and stored on the user's hard drive alongside the script.<br />
The URL specified may be relative to the URL the script is being installed from.<br />
<br />
These named resources may be accessed through [[GM_getResourceText]] and [[GM_getResourceURL]] respectively.<br />
<br />
<br />
''Note that since [[Version_history#0.9.0|Greasemonkey 0.9.0]], if the script is run Greasemonkey detects that the @resource or @require values within the MetaData block has been altered since the script was last run, it triggers the script to be reinstalled with the updated MetaData (thus each @resource and @require shall be re-downloaded).''<br />
<br />
=== @unwrap ===<br />
<br />
Compatibility: [[Version_history#0.8.20090123.1|Greasemonkey 0.8.1+]]<br />
<br />
Example:<br />
// @unwrap<br />
<br />
This declarative key has no associated value.<br />
It changes the interpretation of the script as it executes.<br />
<br />
Normally, greasemonkey scripts are wrapped in an anonymous function when they are executed.<br />
This behavior started in very early versions of greasemonkey, which ran scripts directly in the content page, to separate their variables from those in the page.<br />
In later versions, it remains because isolating the script from the [[sandbox]] scope still helps in certain cases.<br />
<br />
This key is strongly recommended to only be used for [[Global_object#Debugging|debugging]] purposes.<br />
<br />
=== @version ===<br />
<br />
Compatibility: [[Version_history#0.9.0|Greasemonkey 0.9.0+]]<br />
<br />
Example:<br />
// @version 1.0<br />
<br />
This version is, as of Greasemonkey 0.9.0, only used for display in the script management interface.<br />
It should be treated like a [https://developer.mozilla.org/en/install_manifests#version firefox extension version], and maintain the [https://developer.mozilla.org/en/Extension_Versioning%2c_Update_and_Compatibility same syntax].<br />
<br />
== Examples ==<br />
<br />
<pre class='sample'><nowiki><br />
// ==UserScript==<br />
// @name My Script<br />
// @namespace http://www.example.com/gmscripts<br />
// @description Scripting is fun<br />
// @include http://www.example.com/*<br />
// @include http://www.example.org/*<br />
// @exclude http://www.example.org/foo<br />
// @require foo.js<br />
// @resource resourceName1 resource1.png<br />
// @resource resourceName2 http://www.example.com/resource2.png<br />
// @version 1.0<br />
// @icon http://www.example.net/icon.png<br />
// ==/UserScript==<br />
</nowiki></pre><br />
<br />
== See Also ==<br />
<br />
* [[API reference]]<br />
* [[Knowing Your Own Metadata]]<br />
* [[Third-Party Libraries]]<br />
<br />
== Notes ==<br />
<br />
[[Category:API Reference]]</div>Kwahhttps://wiki.greasespot.net/index.php?title=GM.setValue&diff=6346GM.setValue2011-05-11T01:23:24Z<p>Kwah: clarify that it refers to the script's name</p>
<hr />
<div>{{DISPLAYTITLE:GM_setValue}}<br />
<br />
== Description ==<br />
<br />
This method allows user script authors to persist simple values across page-loads.<br />
<br />
Strings, booleans, and integers are currently the only allowed data types. <br />
Values are saved in the [https://developer.mozilla.org/en/Code_snippets/Preferences Firefox preferences] back end and can be manually inspected or changed by typing [[mozillazine:About:config|about:config]] in the address bar and searching for the preference name "<code>greasemonkey.scriptvals.[[Metadata Block#.40namespace|namespace]]/[[Metadata Block#.40name|script_name]].value_name</code>".<br />
(For appropriate values of <code>namespace</code>, <code>script_name</code> and <code>value_name</code>.)<br />
<br />
The Firefox preference store is not designed for storing large amounts of data. There are no hard limits, but very large amounts of data may cause Firefox to consume more memory and/or run more slowly.<br />
<sup>[[#Notes|[1]]]</sup><br />
<br />
Compatibility: [[Version_history#0.3_beta|Greasemonkey 0.3b+]]<br />
<br />
== Syntax ==<br />
<br />
{{Function|GM_setValue|name, value}}<br />
<br />
=== Arguments ===<br />
<br />
; <code>name</code><br />
: <code>String</code> The unique (within this script) name for this value. Should be restricted to valid Javascript identifier characters.<br />
; <code>value</code><br />
: <code>String</code>, <code>Integer</code> or <code>Boolean</code> Any valid value of these types. Any other type may cause undefined behavior, including crashes.<br />
<br />
=== Returns ===<br />
<br />
<code>undefined</code><br />
<br />
== Examples ==<br />
<br />
Set the name foo to hold the value bar:<br />
<pre class='sample'><br />
GM_setValue("foo", "bar");<br />
</pre><br />
<br />
== See Also ==<br />
<br />
* [[GM_getValue]]<br />
* [[GM_deleteValue]]<br />
* [[GM_listValues]]<br />
* [[:Category:Coding Tips:Persistence]]<br />
<br />
== Notes ==<br />
<br />
<sup>[[GM_setValue#top|[1]]]</sup> Please see [http://groups.google.com/group/greasemonkey-users/t/ca5a0dfac5c5998b this mailing list thread] for details.<br />
<br />
[[Category:API_Reference|S]]</div>Kwahhttps://wiki.greasespot.net/index.php?title=GM.setValue&diff=6345GM.setValue2011-05-11T01:19:48Z<p>Kwah: added description to code example;</p>
<hr />
<div>{{DISPLAYTITLE:GM_setValue}}<br />
<br />
== Description ==<br />
<br />
This method allows user script authors to persist simple values.<br />
<br />
Strings, booleans, and integers are currently the only allowed data types. <br />
Values are saved in the [https://developer.mozilla.org/en/Code_snippets/Preferences Firefox preferences] back end and can be manually inspected or changed by typing [[mozillazine:About:config|about:config]] in the address bar and searching for the preference name "<code>greasemonkey.scriptvals.[[Metadata Block#.40namespace|namespace]]/[[Metadata Block#.40name|name]].value_name</code>".<br />
(For appropriate values of <code>namespace</code>, <code>name</code> and <code>value_name</code>.)<br />
<br />
The Firefox preference store is not designed for storing large amounts of data. There are no hard limits, but very large amounts of data may cause Firefox to consume more memory and/or run more slowly.<br />
<sup>[[#Notes|[1]]]</sup><br />
<br />
Compatibility: [[Version_history#0.3_beta|Greasemonkey 0.3b+]]<br />
<br />
== Syntax ==<br />
<br />
{{Function|GM_setValue|name, value}}<br />
<br />
=== Arguments ===<br />
<br />
; <code>name</code><br />
: <code>String</code> The unique (within this script) name for this value. Should be restricted to valid Javascript identifier characters.<br />
; <code>value</code><br />
: <code>String</code>, <code>Integer</code> or <code>Boolean</code> Any valid value of these types. Any other type may cause undefined behavior, including crashes.<br />
<br />
=== Returns ===<br />
<br />
<code>undefined</code><br />
<br />
== Examples ==<br />
<br />
Set the name foo to hold the value bar:<br />
<pre class='sample'><br />
GM_setValue("foo", "bar");<br />
</pre><br />
<br />
== See Also ==<br />
<br />
* [[GM_getValue]]<br />
* [[GM_deleteValue]]<br />
* [[GM_listValues]]<br />
* [[:Category:Coding Tips:Persistence]]<br />
<br />
== Notes ==<br />
<br />
<sup>[[GM_setValue#top|[1]]]</sup> Please see [http://groups.google.com/group/greasemonkey-users/t/ca5a0dfac5c5998b this mailing list thread] for details.<br />
<br />
[[Category:API_Reference|S]]</div>Kwahhttps://wiki.greasespot.net/index.php?title=GM.getValue&diff=6344GM.getValue2011-05-11T01:16:54Z<p>Kwah: added descriptions to code examples; added extra usage samples;</p>
<hr />
<div>{{DISPLAYTITLE:GM_getValue}}<br />
<br />
== Description ==<br />
<br />
This method retrieves a value that was set with [[GM_setValue]].<br />
See [[GM_setValue]] for details on the storage of these values.<br />
<br />
Compatibility: [[Version_history#0.3_beta|Greasemonkey 0.3b+]]<br />
<br />
== Syntax ==<br />
<br />
{{Function|GM_getValue|name, default}}<br />
<br />
=== Arguments ===<br />
<br />
; <code>name</code><br />
: <code>String</code> The property name to get. See [[GM_setValue#Arguments|GM_setValue]] for details.<br />
; <code>default</code><br />
: Optional. Any value to be returned, when no value has previously been set.<br />
<br />
=== Returns ===<br />
<br />
; When this <code>name</code> has been set<br />
: <code>String</code>, <code>Integer</code> or <code>Boolean</code> as previously set<br />
; When this <code>name</code> has not been set, and <code>default</code> is provided<br />
: The value passed as <code>default</code><br />
; When this <code>name</code> has not been set, and <code>default</code> is not provided<br />
: <code>undefined</code><br />
<br />
== Examples ==<br />
<br />
Retrieving the value associated with the name 'foo':<br />
<pre class='sample'><br />
//outputs either the value associated to foo, else undefined<br />
<br />
GM_log(GM_getValue("foo")); <br />
</pre><br />
<br />
Retrieving the value associated with the name 'timezoneOffset' with a default value defined:<br />
<pre class='sample'><br />
//GM_getValue() returns the value -5 (integer) if no value <br />
// associated with the name timezoneOffset is found in storage<br />
<br />
GM_log(GM_getValue("timezoneOffset", -5)); <br />
</pre><br />
<br />
<br />
A more complex example: <br />
<br />
If you have used JSON.stringify to [http://wiki.greasespot.net/Talk:Greasemonkey_Manual:API#GM_getObject.2FGM_setObject place an object into storage], JSON.parse shall be used to convert it back from a string to a [http://www.w3schools.com/js/js_objects.asp Javascript Object]<br />
<pre class='sample'><br />
//Note that if the value associated with foo is an invalid<br />
// JSON string, JSON.parse will fail.<br />
// Also Note the default value is in quotes (thus a string) rather than an object literal<br />
<br />
var storedObject = JSON.parse( GM_getValue("foo", "{}") ); <br />
<br />
if(!storedObject) {<br />
//JSON.parse() should never return any value that type-casts to false, assume there is an <br />
// error in the input string<br />
GM_log('Error! JSON.parse failed - The stored value for "foo" is likely to be corrupted.');<br />
throw;<br />
}<br />
</pre><br />
<br />
== See Also ==<br />
<br />
* [[GM_setValue]]<br />
* [[GM_deleteValue]]<br />
* [[GM_listValues]]<br />
<br />
[[Category:API_Reference|G]]</div>Kwahhttps://wiki.greasespot.net/index.php?title=GM.deleteValue&diff=6343GM.deleteValue2011-05-11T00:43:30Z<p>Kwah: Added extra example</p>
<hr />
<div>{{DISPLAYTITLE:GM_deleteValue}}<br />
<br />
== Description ==<br />
<br />
This method deletes an existing name / value pair from storage.<br />
<br />
See [[GM_setValue]] for details regarding the storage of these values.<br />
<br />
== Syntax ==<br />
<br />
{{Function|GM_deleteValue|name}}<br />
<br />
Compatibility: [[Version_history#0.8.20090123.1|Greasemonkey 0.8.1+]]<br />
<br />
== Arguments ==<br />
<br />
; <code>name</code><br />
: Property name to delete. See [[GM_setValue#Arguments|GM_setValue]] for details on what names are valid.<br />
<br />
== Returns ==<br />
<br />
<code>undefined</code><br />
<br />
== Examples ==<br />
<br />
Delete the stored name / value pair that has the name 'foo':<br />
<pre class='sample'><br />
GM_deleteValue("foo");<br />
</pre><br />
<br />
Example showing the use of [[GM_listValues]] to delete ''all'' stored name / value pairs:<br />
<pre class='sample'><br />
var keys = GM_listValues();<br />
for (var i=0, key=null; key=keys[i]; i++) {<br />
GM_deleteValue(key);<br />
}<br />
</pre><br />
<br />
Similar example to the above, but with a filter within the loop to exclude 'a' and 'foo' and 'bar' from deletion: <br />
<pre class='sample'><br />
var keysToKeep = ['a','foo','bar'];<br />
var keys = GM_listValues();<br />
for (var i=0, key=null; key=keys[i]; i++) {<br />
if(keysToKeep.indexOf(key) >= 0) {<br />
continue;<br />
}<br />
GM_deleteValue(key);<br />
}<br />
</pre><br />
<br />
== See Also ==<br />
<br />
* [[GM_getValue]]<br />
* [[GM_setValue]]<br />
* [[GM_listValues]]<br />
<br />
== Notes ==<br />
<br />
An issue that some may encounter on some platforms is that the values appear to not be deleted or set.<br />
This is usually due to a refreshing issue in the browser.<br />
If about:config is refreshed in the window/tab this should resolve any questions about stability of setting and deleting system preferences.<br />
<br />
[[Category:API_Reference|D]]</div>Kwahhttps://wiki.greasespot.net/index.php?title=GM.deleteValue&diff=6342GM.deleteValue2011-05-11T00:42:46Z<p>Kwah: added descriptions to code examples;</p>
<hr />
<div>{{DISPLAYTITLE:GM_deleteValue}}<br />
<br />
== Description ==<br />
<br />
This method deletes an existing name / value pair from storage.<br />
<br />
See [[GM_setValue]] for details regarding the storage of these values.<br />
<br />
== Syntax ==<br />
<br />
{{Function|GM_deleteValue|name}}<br />
<br />
Compatibility: [[Version_history#0.8.20090123.1|Greasemonkey 0.8.1+]]<br />
<br />
== Arguments ==<br />
<br />
; <code>name</code><br />
: Property name to delete. See [[GM_setValue#Arguments|GM_setValue]] for details on what names are valid.<br />
<br />
== Returns ==<br />
<br />
<code>undefined</code><br />
<br />
== Examples ==<br />
<br />
Delete the stored name / value pair that has the name 'foo':<br />
<pre class='sample'><br />
GM_deleteValue("foo");<br />
</pre><br />
<br />
Example showing the use of [[GM_listValues]] to delete ''all'' stored name / value pairs:<br />
<pre class='sample'><br />
var keys = GM_listValues();<br />
for (var i=0, key=null; key=keys[i]; i++) {<br />
GM_deleteValue(key);<br />
}<br />
</pre><br />
<br />
== See Also ==<br />
<br />
* [[GM_getValue]]<br />
* [[GM_setValue]]<br />
* [[GM_listValues]]<br />
<br />
== Notes ==<br />
<br />
An issue that some may encounter on some platforms is that the values appear to not be deleted or set.<br />
This is usually due to a refreshing issue in the browser.<br />
If about:config is refreshed in the window/tab this should resolve any questions about stability of setting and deleting system preferences.<br />
<br />
[[Category:API_Reference|D]]</div>Kwahhttps://wiki.greasespot.net/index.php?title=Category:Scripting_context&diff=6339Category:Scripting context2011-05-08T18:57:22Z<p>Kwah: Undo revision 6338 by Twilad27 (talk) -- Spam link</p>
<hr />
<div></div>Kwahhttps://wiki.greasespot.net/index.php?title=Greasemonkey_Manual:Getting_Help&diff=6334Greasemonkey Manual:Getting Help2011-05-08T03:04:28Z<p>Kwah: Added some more structure to the page and altered the prose to be more readable; Still needs work to make the page more concise though;</p>
<hr />
<div>{{Greasemonkey Manual TOC}}<br />
<br />
If you've run through all the [[Troubleshooting (Users)|troubleshooting]] steps and things still aren't working how you might expect them to, one of the benefits of an open source project is that there are communities of people who use Greasemonkey who may be able to share their experience to help you get back on track.<br />
<br />
<br />
__TOC__<br />
<br />
<br />
== What to Do First ==<br />
<br />
Before you ask for help, you should make a reasonable effort to help narrow down exactly what the issue you are having is - ''Help us to help you''. <br />
<br />
Without doing the basic groundwork to get that information, even someone who really really really wants to help you can only, at best, guess at what the problem might be.<br />
<br />
By providing detailed information early on, it shows that you are willing to put the effort in yourself. <br />
This makes it easier to see what is wrong and makes you look like a good person. <br />
In other words, it makes it more likely that someone will be willing to ''volunteer'' their time to help you.<br />
<br />
==== Do Some Troubleshooting ====<br />
The first step is to start by [[Troubleshooting (Users)|troubleshooting]] yourself.<br />
This is important as lots of problems reported are common issues that are solved very easily.<br />
<br />
==== Collect the Information Together ====<br />
After doing this troubleshooting, you must be ready to explain what you've already done and what the results were.<br />
<br />
After all, since losing our psychic powers, not describing what is or is not working it will make it difficult to understand what is happening on your computer.<br />
<br />
Communicating what is happening on your computer, what you think it should actually be doing and what you've already done to try and figure out ''why'' it isn't behaving in the way you expect is probably '''the''' most important step. <br />
In fact, it deserves a section of its own..<br />
<br />
<br />
== What to Say ==<br />
<br />
After going through the basic troubleshooting steps yourself, it is time to decide what you are going to tell the [#Where_to_Say_It relevant person].<br />
<br />
The reason ''every'' piece of this information is important is because there are so many things that could be going wrong it is important to help someone else be able to reproduce the problem.<br />
Maybe it is a problem with a script, maybe it is a problem with Greasemonkey. <br />
<br />
Either way, if a Greasemonkey developer can cause the error appear on their own screen then they can find it ''much'' easier to figure out how to fix it.<br />
<br />
==== ''All'' of the following: ====<br />
<br />
* Operating System <br />
** (E.G. Windows XP, Windows 7, Mac OS X Snow Leopard, Ubuntu Linux 8.10)<br />
<br />
* Firefox version <br />
** (Open <tt>Help</tt>, <tt>About Mozilla Firefox</tt> then select and copy the last line of text, E.G. "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6".)<br />
<br />
* Greasemonkey version <br />
** (Find it in <tt>Tools</tt>, <tt>Add-ons</tt>, E.G. <tt>0.8.20091209.4</tt>.)<br />
<br />
* Exactly which script, if any, is causing a problem? <br />
** Give an exact name, and if '''at all''' possible, the URL where it can be found.<br />
<br />
* Exactly which page, if any, is exhibiting this problem. <br />
** Please give a URL. If some sort of registration or login or other permission is required, please state this instead.<br />
<br />
<br />
==== Note about scripts ====<br />
<br />
If you are a script author, including the exact code that is causing problems is ''really'' important.<br />
<br />
The best option is to provide a URL to some sort of pastebin service, like [http://gist.github.com ''gist.github.com''] or [http://pastebin.com/ ''pastebin.com''], which can communicate the entire, and exact, source code causing the problem.<br />
Equally important is providing the ''whole'' script, not just a few lines of code as in many cases the real problem might lie elsewhere; without being able to see that code, nobody can help you for sure.<br />
<br />
If you provide the source code via email, '''please''' do not paste it into the body of your message: e-mail clients will wrap lines, change characters, and generally break the code in other subtle ways.<br />
Attaching the source code as a file makes sure it is not broken in transit.<br />
<br />
<br />
== Where to Say It ==<br />
<br />
Great! You have all of this lovely information. Now you just need to decide where to send it ;)<br />
<br />
Here's a quick guide for some good places to look:<br />
<br />
* If your problem is with a specific user script, you should first contact the original author of the script. <br> If you downloaded it from userscripts.org then either send a message to the scriptwright or add a Discussion to the script's page.<br />
* If you ''are'' the author of the script (a scriptwright) and you need help with JavaScript, [http://www.stackoverflow.com/ http://www.stackoverflow.com/] and the [https://developer.mozilla.org/ Mozilla Developer Centre (MDC)] are excellent places to ask questions or look up reference material.<br />
* Alternatively, you can post a message to the [http://groups.google.com/group/greasemonkey-users greasemonkey-users] mailing list. <br />
* Also available are the [http://userscripts.org/forums forums at userscripts.org], with multiple appropriate topics.<br />
* Finally, you may also try IRC: irc://irc.freenode.net/#greasemonkey<br />
<br />
<br />
== See Also ==<br />
<br />
* [http://catb.org/~esr/faqs/smart-questions.html How To Ask Questions the Smart Way]</div>Kwahhttps://wiki.greasespot.net/index.php?title=Metadata_Block&diff=6328Metadata Block2011-05-07T15:45:15Z<p>Kwah: Added note re:the opening & closing of the metadata block must at the beginning of their lines</p>
<hr />
<div>== Description ==<br />
<br />
The '''metadata block''' is a section of a [[user script]] that describes the script.<br />
It usually contains the script name, namespace, description, and [[include and exclude rules]].<br />
The metadata block appears in JavaScript line comments and may appear anywhere in the top level Greasemonkey code scope of the script, but is usually near the top of the file.<br />
<br />
If the metadata block includes a key that Greasemonkey does not understand, it will simply be ignored.<br />
Some authors choose to include their own keys, and [http://userscripts.org userscripts.org] defines a set of metadata keys for varying purposes.<br />
<br />
As of [[Version_history#0.9.0|Greasemonkey 0.9.0]], the metadata block is reloaded any time the file changes, just like the rest of the source in the script.<br />
In any older version, one must re-install the script for metadata changes to be recognized.<br />
In 0.9.0+, editing the script is how (e.g.) <code>@include</code> and <code>@exclude</code> rules are customized.<br />
All of the metadata imperatives can be added, removed, or changed, but be careful with the <code>@name</code> and <code>@namespace</code> imperatives: their combination must remain unique among installed scripts, so changing them can cause problems.<br />
<br />
== Syntax ==<br />
<br />
The metadata block must follow the format:<br />
<br />
<pre class='sample'><br />
// ==UserScript==<br />
// @key value<br />
// ==/UserScript==<br />
</pre><br />
<br />
It must use line comments (<code>//</code>) like above, not block comments (<code>/* */</code>).<br />
Note that the opening <code>// ==UserScript==</code> and closing <code>// ==/UserScript==</code> must be precisely at the beginning of its line.<br />
Some keys may have multiple values.<br />
In all cases the key and value(s) are separated by whitespace.<br />
The closing <code>==/UserScript==</code> line should be at the end of the metadata block (not at the end of the script).<br />
<br />
=== @description ===<br />
<br />
Example:<br />
// @description This script even does the laundry!<br />
<br />
Just a brief summary of what the script does, presented to the user as the script is installed, and in the manage dialog.<br />
<br />
=== @exclude ===<br />
<br />
Examples: see @include<br />
<br />
See [[Include and exclude rules]].<br />
There can be any number of @exclude rules in a script.<br />
<br />
=== @icon ===<br />
<br />
Compatibility: [[Version_history#0.9.0|Greasemonkey 0.9.0+]]<br />
<br />
Example:<br />
<nowiki>// @icon http://www.example.org/icon.png</nowiki><br />
<br />
The icon is, as of Greasemonkey 0.9.0, displayed in the script management interface.<br />
Almost any image will work, but a 32x32 pixel size is best.<br />
<br />
=== @include ===<br />
<br />
Examples:<br />
<nowiki>// @include http://www.example.com/*</nowiki><br />
<nowiki>// @include http://*</nowiki><br />
<nowiki>// @include *</nowiki><br />
<br />
See [[Include and exclude rules]].<br />
There can be any number of @include rules in a script.<br />
<br />
=== @name ===<br />
<br />
Example:<br />
// @name Example Script<br />
<br />
The name of the script.<br />
This appears in the [[Greasemonkey_Manual:Manage_Dialog|script manager]] and [[Greasemonkey_Manual:Monkey_Menu|monkey menu]], and is also the unique identifier of a script (within a [[#@namespace]]).<br />
If no name is provided, it will be derived from the file name.<br />
<br />
=== @namespace ===<br />
<br />
Example:<br />
<nowiki>// @namespace http://www.example.com/gmscripts</nowiki><br />
<br />
The combination of namespace and name is the unique identifier for a Greasemonkey script.<br />
If a script is being installed, and a script with that same name '''and''' namespace already exists, it will be replaced by the new script.<br />
Otherwise, the new script is added to the set of installed scripts.<br />
A script author will usually put all of their scripts under one common namespace, and then assign each script a unique name.<br />
<br />
While the namespace is non-semantic, a URL is often used.<br />
Some authors use the common home page for the collection of scripts they have written.<br />
But remember, the namespace can be any unique value.<br />
<br />
=== @require ===<br />
<br />
Compatibility: [[Version_history#0.8.20080609.0|Greasemonkey 0.8.0+]]<br />
<br />
Example:<br />
<nowiki>// @require http://www.example.com/example.js</nowiki><br />
<br />
There can be any number of @require keys in a script.<br />
Each @require is downloaded once, when the script is installed, and stored on the user's hard drive alongside the script.<br />
The URL specified may be relative to the URL the script is being installed from.<br />
<br />
See also:<br />
<br />
* [[:Category:@require Library]]<br />
<br />
=== @resource ===<br />
<br />
:Compatibility: [[Version_history#0.8.20080609.0|Greasemonkey 0.8.0+]]<br />
<br />
Example:<br />
<nowiki>// @resource resourceName http://www.example.com/example.png</nowiki><br />
<br />
There can be any number of @resource keys in a script.<br />
<br />
While the resourceName is non-semantic, it should comply with JavaScript identifier restrictions.<br />
Each @resource must have a unique name.<br />
<br />
Each @resource is downloaded once, when the script is installed, and stored on the user's hard drive alongside the script.<br />
The URL specified may be relative to the URL the script is being installed from.<br />
<br />
These named resources may be accessed through [[GM_getResourceText]] and [[GM_getResourceURL]] respectively.<br />
<br />
=== @unwrap ===<br />
<br />
Compatibility: [[Version_history#0.8.20090123.1|Greasemonkey 0.8.1+]]<br />
<br />
Example:<br />
// @unwrap<br />
<br />
This declarative key has no associated value.<br />
It changes the interpretation of the script as it executes.<br />
<br />
Normally, greasemonkey scripts are wrapped in an anonymous function when they are executed.<br />
This behavior started in very early versions of greasemonkey, which ran scripts directly in the content page, to separate their variables from those in the page.<br />
In later versions, it remains because isolating the script from the [[sandbox]] scope still helps in certain cases.<br />
<br />
This key is strongly recommended to only be used for [[Global_object#Debugging|debugging]] purposes.<br />
<br />
=== @version ===<br />
<br />
Compatibility: [[Version_history#0.9.0|Greasemonkey 0.9.0+]]<br />
<br />
Example:<br />
// @version 1.0<br />
<br />
This version is, as of Greasemonkey 0.9.0, only used for display in the script management interface.<br />
It should be treated like a [https://developer.mozilla.org/en/install_manifests#version firefox extension version], and maintain the [https://developer.mozilla.org/en/Extension_Versioning%2c_Update_and_Compatibility same syntax].<br />
<br />
== Examples ==<br />
<br />
<pre class='sample'><nowiki><br />
// ==UserScript==<br />
// @name My Script<br />
// @namespace http://www.example.com/gmscripts<br />
// @description Scripting is fun<br />
// @include http://www.example.com/*<br />
// @include http://www.example.org/*<br />
// @exclude http://www.example.org/foo<br />
// @require foo.js<br />
// @resource resourceName1 resource1.png<br />
// @resource resourceName2 http://www.example.com/resource2.png<br />
// @version 1.0<br />
// @icon http://www.example.net/icon.png<br />
// ==/UserScript==<br />
</nowiki></pre><br />
<br />
== See Also ==<br />
<br />
* [[API reference]]<br />
* [[Knowing Your Own Metadata]]<br />
* [[Third-Party Libraries]]<br />
<br />
== Notes ==<br />
<br />
[[Category:API Reference]]</div>Kwah