Tutorial

Tutorial: Editing Monobook, installing scripts

This week's tutorial explains how to install user scripts that increase the functionality of the encyclopedia's interface. Such tools range from rather simple scripts - for example, that replace some text with other text - to complicated behemoths that do everything from fighting vandalism to closing AFCs.

Basics

If you are using the Monobook skin (for more on skins, see WP:SKIN), your scripts page would be at this location. In general, if you use skin X, your scripts page would be at User:(your username)/X.js.

Once you have navigated to the page, you should see the following box:

If a message on your talk page led you here, please be wary of who left it. The code below could contain malicious content capable of compromising your account; if your account appears to be compromised, it will be blocked. If you are unsure whether the code is safe, you can ask at the appropriate village pump.

This means that unknowingly putting malicious scripts on your scripts page may lead to your account being compromised. One must always be careful when installing scripts.

To install a script, simply edit the page and copy-and-paste the desired script in (or, if you are familiar with Javascript and you know how to use Wikipedia's DOM, type your own). Save the page as your normally would. Generally, you will have to bypass your cache (ctrl + f5 on Firefox and Internet Explorer, simply f5 on Konqueror and command + R on Safari to see the effects of the script.

What can scripts do?

A better question would be, "What can't scripts do?" Scripts, as mentioned briefly above, can change Wikipedia's interface in drastic ways, as well as providing semi-automated ways to edit. The latter is particularly useful for vandalism fighting, though it has many diverse applications.

Some of the most well-known scripts are:

  1. Twinkle, a script which gives added functionality in fighting vandalism
  2. Pop-ups, which allow previews of articles when hovering over links as well as tools to deal with these articles
  3. Lupin's anti-vandal tool, which provides a recent changes filter, a recent IP edits list, and other functionality.
  4. Dr pda's page size tool, which adds a Page size link to the toolbox, to display some statistics about the page and prose size.

Which tools should you install? Consider first which tools you will actually have much use for. If you spend your time voting in XfDs, vandalism reversion scripts may not be useful for you, and vice versa.

Finding scripts

WikiProject User scripts, a WikiProject devoted to scripts, maintains a list of user scripts. One can also request a script be made.

If you wish to use the same scripts as another user, there are two methods. One is to simply substitute their script page onto your own. The second is to use the importScript command, which works as follows:

importScript('OTHER USER'S SCRIPT PAGE');

A more recent feature is the "Gadgets" tab in your preferences page. If you want to use a gadget (user script or CSS modification) that is listed, you simply check a box and save your change. The list includes some of the more well-known scripts. (If you want to customize a script, you'll need to install the scripts manually.)

Other resources




Also this week:
  • WikiWorld
  • News and notes
  • In the news
  • Dispatches
  • WikiProject report
  • Tutorial
  • Features and admins
  • Technology report
  • Arbitration report

  • (← Previous Tutorial) Signpost archives (Next Tutorial→)

    + Add a comment

    Discuss this story

    To follow comments, add the page to your watchlist. If your comment has not appeared here, you can try purging the cache.
    No comments yet. Yours could be the first!





















    Wikipedia:Wikipedia Signpost/2008-03-17/Tutorial