From Wikipedia, the free encyclopedia
Jump to: navigation, search
Darkwind's Anti-Vandal Tool
Developer(s) User:Darkwind
Stable release v0.1.1 / December 1, 2013; 2 years ago (2013-12-01)
Preview release v0.2.0 beta / December 3, 2013; 2 years ago (2013-12-03)
Development status Active
Written in JavaScript
Available in English
Type Wikipedia editing tool
License Free software

Darkwind's Anti-Vandal Tool is a vandalism-fighting tool inspired by the original Lupin's Anti-Vandal Tool. It retrieves a list of recent edits and new pages, and matches them against a list of common vandalism edits. Any matches are displayed with a full diff, along with links to the article history and the user's contributions, talk, etc., allowing the user to easily determine if vandalism occurred and perform a rollback.


  • You must have the Rollback right on the English Wikipedia to use this tool effectively. This tool does not implement a "non-admin" rollback feature.
  • If you do not have rollback, you may still use the tool, but you will have to manually pull up the history of each vandalized article to access undo links or use Twinkle's rollback feature.
  • A reasonably fast computer. The regular expression used by the tool to find vandalism is, frankly, huge, and takes a lot for your web browser to process.
  • A modern web browser (an up-to-date version of Firefox, Chrome, or Opera, and probably Safari). This tool will not function in Internet Explorer 8 and previous, in Firefox 4, or in Safari 3 and previous. It probably will also malfunction in old versions of Chrome and Opera.

Installation and use[edit]

To use the tool, you must first "install" it in your common.js file (for any skin) or vector.js file (only for the default skin).

To do so, copy the following code and paste it into one of the previously mentioned files:

importScript('User:Darkwind/DAVT.js'); // [[User:Darkwind/DAVT.js]]

Please include the wikilink at the end, which helps me track how many people use the tool. Once you have saved your .js page, you must bypass your cache to load the script.

Once you've done so, a link to "Darkwind's AVT" will appear in your "toolbox" (in the left sidebar if you're using the Vector skin). Click the link to open the page where the tool will automatically connect and start downloading recent changes to review. Alternatively, click here to open up the filtering page. Allow at least 30 seconds for the first diffs to start appearing.

For each edit, there's a link to hide the diff/wikitext and a link to dismiss the report entirely There's also a link to the article and its history, a list of what "bad words" the edit matched, and links for information about the editor (talk page, block log, etc.).

The rollback link functions as you might expect, except that it also includes a descriptive edit summary linking to this page. The edit summary specifically calls out the edit(s) you rolled back as vandalism, so it's very important not to use the rollback link if the edit is not actually vandalism. For good-faith edits, use undo or Twinkle's AGF rollback instead.

Diff coloration[edit]

In the diff display itself, the colors are displayed the same as other diffs elsewhere on Wikipedia, except that the "bad word" matches that triggered the Anti-Vandal filter will be displayed with a bright yellow background and slightly larger font.

The yellow coloring does not necessarily mean that the editor added that word or phrase, however. Although the tool only looks for matches in paragraphs that were modified during the edit in question, it may find matches in any pre-existing text in those paragraphs. Due to limitations in the MediaWiki API, it is difficult (maybe impossible) to restrict the matches to just the new text added by the possible vandal.


To configure options for the tool, you must copy and paste the entire block of code below into the same file where you installed the script:

AVTconfig = { //Darkwind's Anti-Vandal Tool configuration
    batchDelay: 30, 
    diffDelay: 90, 
    readDelay: 250, 
    namespaces: "0|2", 
    showTypes: "!minor|!bot", 
    editTypes: "edit|new",
    showByDefault: true,
    areYouThereTimeout: 60 

AVTfilters = { //Darkwind's AVT filter configuration
    groupFilterOn: false, 
    groupFilter: ["sysop", "bureaucrat"], 
    editCountFilterOn: true,
    editCountFilter: 200, 
    titleFilters: [/[Ss]andbox/]

Edit the number or text next to each option as described below. Avoid changing any of the quotes or commas.


The first group of settings contains various options for the tool.

In seconds, this is how often the tool will download a new set of changes to check. The default of "30" mimics the behavior of Lupin's tool, but if you find that you run out of edits to examine, you can decrease this number.
The tool will not download any recent changes newer than this number of seconds, default 90. This helps prevent showing edits that ClueBot etc. will probably revert before you get to them. If you find that you see a lot of edits that have already been reverted, you can increase this number.
In milliseconds, how long the tool will wait between making requests from the server for more information. Generally, you shouldn't need to change this value (and if anything, only increase it).
A list of namespace numbers, separated by pipe characters, which the tool will monitor for vandalism. The default of "0|2" is article space and User space -- talk pages and Wikipedia pages are excluded by default, as they tend to produce a lot of false positives. A reference list of namespace numbers can be found at Wikipedia:Namespace.
A list of edit types to monitor, separated by pipe characters. These options roughly correspond to the options on your Watchlist page -- show/hide minor edits, show/hide bot edits, etc. The default of "!minor|!bot" means hide both minor and bot edits, and show all others (subject to the next option).
Please note that the behavior of this parameter is very specific due to the way the MediaWiki API works. For example, if you specify the anon option, you will see only anonymous edits, and no anonymous edits are shown if you use !anon. To monitor all users both anonymous and registered, you need to omit the anon option entirely.
The following options are available on en.Wikipedia:
  • minor: Only list minor edits
  •  !minor: Don't list minor edits
  • bot: Only list bot edits
  •  !bot: Don't list bot edits
  • anon: Only list edits by anonymous users
  •  !anon: Only list edits by registered users
  • redirect: Only list edits to pages that are currently redirects
  •  !redirect: Only list edits to pages that currently aren't redirects
These are the types of edits, in relation to the action performed, that the tool will monitor. The default of "edit|new" means to show both edits and new pages, but not any other actions such as log entries or "external edits". Modify this option according to your preferences by removing the type of edits you don't want to see and adding those you do.
The available edit types are:
  • edit: Regular page edits
  • external: External edits (generally caused by Wikidata updates)
  • new: Page creations
  • log: Log entries (deletions, blocks, account creation, etc. -- not generally useful for this tool)
If this option is false, each edit which matches the filter will be shown on the page in a summary/collapsed state, and you can click "show" to view the full diff. If the option is true, the full diff is displayed automatically, but you can click "hide" to hide it.
In order to avoid unnecessarily draining server resources running a tool you're not using, the script will pause after this many minutes, and ask you whether you want to continue. The maximum timeout is 90 minutes; higher or 0 values will be ignored.


The second group of settings contains filters to limit the number of "false positives" the tool shows.

If true, the tool will not show any edits from users who belong to one or more of the groups listed in the next option. This can be used to filter out edits by sysops (admins), rollbackers, filemovers, etc. This filter is disabled by default.
If the groupFilterOn option is set to true, this list is used to select which groups whose edits you do NOT want to see in the Anti-Vandal Tool. The example provided is sysops and bureaucrats, but any of the user groups listed at WP:RIGHTS or in the dropdown list at Special:ListUsers will work. This list must be formatted as a JavaScript array, as shown in the example.
If set to true, the tool will use the following option to filter editors by their edit count. Edits by users with an edit count equal to or higher than the next option will not be shown in the tool.
The number of edits to use as a threshold when the edit count filter is turned on. It is set to 200 by default, since that's generally the guideline for enrolling in WP:CVUA.
This option consists of an array of JavaScript regular expressions used to filter pages by title. Any edits to pages with a title matching one or more of these expressions will not be shown. The default option filters out any pages with the word "sandbox" in the title. Please note that this filter cannot be turned off for technical reasons, but you can remove the filters and just leave an empty set of brackets [] if you wish.


This tool is still in an early phase of development, but it is functional. It has been tested extensively only on Firefox 24 and 25 and Chrome, but should also work in Internet Explorer (9 and above), and Opera.

  • Hotfix: Timestamps are now working (again)
  • New feature: Rollback now includes a descriptive edit summary which links to this page
  • First stable release
  • Filters now available to reduce false positives: optionally filter by user group, edit count, and/or page title
  • User timeout feature now works correctly; after the configurable delay, the script will ask if you want to continue
  • Any user or anon you attempt to roll back will be tracked and all their future edits will be displayed for review (per-session only)
  • Session whitelist feature: if you notice a constructive editor who keeps coming up (perhaps they keep editing a page that contains filtered words), you can whitelist them for the current session so their edits stop appearing
  • "Remove prior" option: on any given diff, you can click "dismiss + prior" to remove that diff and any still remaining above it
  • NOTE: to enable the vandal tracking feature, the tool now creates a "popup" window to perform the actual rollback. You will need to enable popups for to use the rollback feature.
  • Hotfix: Diffs are now properly colored with the site's normal diff coloration. Thanks to Antiqueight for pointing out this issue.

Known issues[edit]

Future development[edit]

Future plans include:

  • Implement the other modes of Lupin's tool (watchlist monitoring, monitor all anonymous edits, and live spellcheck).
  • Implement "live" checkboxes for options, or a configuration form/tool, instead of having to edit your user .js file by hand.
  • Trim down/improve the /badwords list to reduce false positives and speed up the tool.
  • Add more options to reduce the number of edits shown, again with the intent to reduce false positives: hide my own edits, hide admin edits done, hide registered editors over a certain edit count done, etc.

I welcome everyone's suggestions for additional features (see below) or if you want to contribute directly to the code, that's great as well -- there's a GitHub repository set up, mostly so I can keep track of what I'm doing, but you can use it too. Feel free to clone and improve.

Beta version[edit]

A beta version of the next major update is available for testing if you would like to try it out. You can find instructions on the beta page. The beta version includes inline rollback, as well as revert-and-warn functionality.

Why this tool?[edit]

You might ask "why do we need another anti-vandalism tool? We already have Huggle, STiki, and RTRC, and even Lupin's original tool is still mostly working. And ClueBot NG is faster than I am anyway!"

All of these tools are useful in their own ways, but having a variety of options is always good. This tool performs more filtering than Huggle, reducing the number of changes to examine, and unlike STiki it runs inside the web browser for closer integration with your existing Wikipedia tools. Also, if you're an experienced user of Lupin's tool or STiki, you probably already know how many edits ClueBot either misses, or cannot revert due to its self-imposed 1RR rule.

As for Lupin's tool, it has not been significantly updated since 2008, and was introduced before some major updates to Wikipedia's architecture (such as the API for recent changes). Since it polls the RSS recent changes feed only every 30 seconds, it misses edits due to the limitations of that feed. This tool is new code in the spirit of Lupin's tool (only the "badwords" code was borrowed), using jQuery for flexibility and exclusively using the API to access data.


Please ask any questions, report bugs, provide feedback, etc. at User talk:Darkwind/DAVT. If you have a GitHub account, you can also add issues directly to the GitHub issue tracker at if you prefer.