This userscript will automatically hide all spoilers in articles on Wikipedia. It requires no alterations to any article, and it is extremely effective in hiding all spoilers in mainspace.

Usage

edit

Add the following to your common.js:

importScript('User:Anomie/hidespoilers.js'); // Linkback: [[User:Anomie/hidespoilers.js]]

Any article containing spoilers will be hidden behind a box similar to the following, just under the title:

This article may contain spoilers

Caveats

edit
  • It does not attempt to hide spoilers in namespaces other than the main namespace.
  • It does not attempt to hide spoilers in anything besides normal pageviews. For example, it does not affect diff views, history views, or the like.
  • If the page is very large or particularly slow to complete loading, spoilers may be visible for a short time before the script can take effect. To work around this issue, do not look at the page until it is done loading.
  • Javascript errors in other gadgets scripts may cause this script to stop functioning.
  • As a tradeoff for its extreme effectiveness in hiding spoilers, it may be prone to false positives.