O'Reilly logo

Wikipedia: The Missing Manual by John Broughton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding and Deleting Scripts

To use user scripts, you create a personal JavaScript page, which only you and Wikipedia administrators can edit. On this page, you put the user scripts that you want to use, or pointers to other pages where JavaScript code is stored (which Wikipedia uses to add code to your page).

When you want to stop using a script, you edit that personal page, deleting the JavaScript code or pointer, or marking it as non-executable information. That’s called commenting it out, and it just means you’re telling the Wikipedia software not to follow those instructions.

Note

In late 2007, Wikipedia added a new feature that lets you implement user scripts with just a couple of clicks. On the My Preferences page, check the Gadgets tab to see if the script you want to add is listed on that tab. If so, you can save time by turning it on that tab, rather than following the instructions in this section. (For details, see Gadgets.)

Your Personal JavaScript Page

Creating your JavaScript page is as easy as creating a subpage in your own user space, as described in Chapter 3. See Personal Subpages if you need a refresher on subpages. This chapter assumes that you’re using the standard Monobook skin for your Wikipedia window (Skin), and so you’ll name your personal page monobook.js. (If you use a different skin, see the box on Removing Scripts.)

When you’re ready to do the JavaScript jive, go to your user page, and follow these steps:

  1. On your user page, click “edit this page”. In the edit ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required