User:Rod McGuire/Wiki defined example user scripts

From GreaseSpot Wiki
< User:Rod McGuire
Revision as of 20:12, 2 February 2010 by Rod McGuire (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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. AND Gresemonkey will prevent you from seeing the wiki page.
  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.