Jump to content

User:Eejit43/scripts/ajax-undo

From Wikipedia, the free encyclopedia
User script
ajax-undo
Top: history view before button click
Bottom: diff view after button click
DescriptionUser script to easily undo edits
AuthorEejit43
First releasedFebruary 16, 2023; 3 years ago (2023-02-16)
UpdatedJuly 12, 2026; 6 days ago (2026-07-12)
BrowsersTested on Chromium and Firefox
Skins
SourceUser:Eejit43/scripts/ajax-undo.js
GitHub repositoryajax-undo.ts

This user script adds a link following "undo" on page histories and diff views, allowing the edit to be undone without leaving the history/diff page. It allows for an optional comment to add to the edit summary.

Recent notable changes

For a more detailed changelog, see the script's GitHub commit history.

  • July 12, 2026; 6 days ago (2026-07-12): Add dark mode support.
  • January 13, 2026; 6 months ago (2026-01-13): Fetch undo summary message for local language rather than using hardcoded value.

Installation

Simple

Install Enterprisey's "script-installer" (at Preferences → Gadgets → Advanced → Tick Install scripts without having to manually edit JavaScript files (documentation)), then come back to this page and click the "Install" button in the infobox on the right.

Manual

Add the following to your common.js (or a skin specific JavaScript page):

{{subst:install user script|User:Eejit43/scripts/ajax-undo.js}}

Global and other wiki installation

To install this user script globally, across all Wikimedia projects, add the following to your global.js on Meta-Wiki. See meta:Global user pages for more information.

This same method can be used to install the script on projects outside of the English Wikipedia, or even on MediaWiki wikis outside of Wikimedia.

mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Eejit43/scripts/ajax-undo.js&action=raw&ctype=text/javascript'); // Backlink: [[w:en:User:Eejit43/scripts/ajax-undo.js]]

Note: if you install this script here and globally, it will be double-loaded. Add a check in your global.js to prevent this from happening as seen in this permalink, or simply only install the script in one location.

Comments/bug reports

Please leave comments or report bugs on my talk page, or file an issue on the GitHub repository.