User:Rod McGuire/Wiki defined example user scripts: Difference between revisions

From GreaseSpot Wiki
Jump to navigationJump to search
(Created page with 'Example user scripts can be defined in the Greasespot wiki. Currently such wiki pages seem to be creatable only in <code>User:</code> space. One could try creating a page such …')
(No difference)

Revision as of 20:08, 2 February 2010

Example user scripts can be defined in the Greasespot wiki.

Currently such wiki pages seem to be creatable only in User: space.

One could try creating a page such as User:Rod_McGuire/dataschemetest.user.js, but this has two problems:

  1. If you try to access such a wiki page when Greasemonkey is running, Greasemonkey will try to install the wiki page, not its Javascript code, as a user script.
  2. There is no direct way to install the Javascript code as a script in Greasemonkey.

The solution is to define a user script page with a name that ends in .js, but not .user.js, such as User:Rod_McGuire/dataschemetest.u.js, then use Template:RawWikiUserscript to create a link to the raw Javascript text (for example: dataschemetest.user.js) that can cause Greasemonkey to treat the content as an installable script.