mark-locked is a user script that visually marks links to globally locked accounts on Wikimedia pages.

The script scans links to user pages, user talk pages, contributions pages, and CentralAuth pages, checks whether the corresponding accounts are globally locked, and marks matching links with a visual indicator showing the lock details, including a tooltip where applicable.

Installation

edit

Add the following line to your common.js page (or another personal JavaScript page that you load):

mw.loader.load('//en.wikipedia.org/wiki/User:GeneralNotability/mark-locked.js?action=raw&ctype=text/javascript');

Then bypass your browser cache (often Ctrl+F5 or Ctrl+Shift+R).

Usage

edit

After installation, the script runs automatically whenever a page loads.

The script scans visible content for links pointing to:

  • User:
  • User talk:
  • Special:Contributions/
  • Special:CentralAuth/

If an account is globally locked, matching links are visually modified:

  • reduced opacity,
  • a red dashed underline,
  • a tooltip containing lock information.

Hovering over a marked link displays additional information, when available, such as:

Locked by ExampleSteward: Cross-wiki abuse (12.03d ago)

Appearance

edit

By default, links to globally locked users are visually modified to make them easier to recognize while reading pages.

Locked-user links are displayed with:

  • reduced opacity (40% opaque),
  • a thick dashed red underline,
  • a tooltip containing lock information (when available).

The tooltip may include details such as the locking steward, lock reason, and how long ago the lock occurred.

The appearance is applied automatically and affects only display in your browser; page content is not modified.

This affects only display and does not modify page content.

Example

edit

The following example illustrates how links to globally locked users may appear after the script processes the page. In this example, both comments were written in July 2024, but the second user account was globally locked at a later date.

This looks good to me. I adjusted the wording slightly and added a source for the final paragraph. — Example1 (talk) 14:26, 17 July 2024 (UTC)

Thanks — I agree that the additional source improves readability and makes the conclusion easier to follow. — Lockeroo (talk) 14:41, 17 July 2024 (UTC)

In this example, the second user's signature is shown with the appearance used by the script: reduced opacity, a thick dashed red underline, and a tooltip containing lock details. (Underlying user and talk page links of the fake 'locked user' are not active here due to technical limitations, but will work in the installed script.) Actual tooltip text and appearance may vary depending on browser behavior and available lock-log information.

Performance

edit

The script batches API requests to reduce load.

Two APIs are used:

  • the local wiki API to determine whether accounts are globally locked;
  • the Meta-Wiki API to retrieve lock-log details.

Users with the apihighlimits right may process larger batches.

Notes

edit
  • IP addresses are ignored and are not checked for global locks.
  • Usernames are normalized using MediaWiki title handling to match server-side capitalization behavior.
  • If lock-log details are unavailable, locked accounts are still marked, but the tooltip may be empty.
  • The script updates dynamically when page content changes through MediaWiki hooks.

Compatibility

edit

The script is intended for Wikimedia wikis using MediaWiki JavaScript and ResourceLoader.

It has been tested with standard page views and should work with dynamically loaded content.

Limitations

edit
  • Only globally locked accounts are marked; local blocks are not shown.
  • Links that do not resolve to recognizable user-related URLs are ignored.
  • The tooltip is not visible for users of the native mobile app.
  • Visual appearance depends on browser styling and other gadgets or user scripts.

See also

edit