User talk:Novem Linguae/Scripts/UserHighlighterSimple

Latest comment: 1 month ago by Novem Linguae in topic Topic bans

Green and grey went out

edit

To editor Novem Linguae: A couple days ago it seems the green highlight of >10k edits and the grey of >500 edits went out. Chris Troutman (talk) 19:52, 8 March 2024 (UTC)Reply

It's working again; thanks. Chris Troutman (talk) 20:35, 8 March 2024 (UTC)Reply
Thanks for reporting this Chris. I temporarily fixed it. It's some kind of bug affecting NovemBot and Toolforge. It can be observed by looking at the -1.6 million byte diffs in this edit history. Will try to release a patch for this soon. –Novem Linguae (talk) 22:29, 8 March 2024 (UTC)Reply
Fixed I think. I added some code that checks how much data the bot wants to write, and if it is less than 1 million bytes, it will skip that day. Please let me know if it happens again, although I think this should do the trick. –Novem Linguae (talk) 08:54, 9 March 2024 (UTC)Reply

Show bots a different colour

edit

Here's a suggestion. For username highlighter, show bots under a different colour. It makes no sense to show them regular green. A simple unobstrusive grey or similar might be way better. Soni (talk) 00:22, 9 June 2024 (UTC)Reply

I'm on the fence about this one. Any other talk page watchers interested in this? –Novem Linguae (talk) 00:45, 9 June 2024 (UTC)Reply
@Novem Linguae I do support it. No comments about which color though. Bunnypranav (talk) 11:23, 27 October 2024 (UTC)Reply

Toggle

edit

Novem Linguae, I just became aware of the existence of this script at the current RfA Talk page. I have what I think is a simple question. If I install it, does it automatically run on every page I look at? If yes, is there a way to turn it off without uninstalling it, and turn it back on when I wish to be dazzled by color? Thanks.--Bbb23 (talk) 20:38, 14 June 2024 (UTC)Reply

It doesn't currently have a toggle. If you only want to run it on RFA subpages, that would be easy to script up in common.js and I could help with that. If you prefer a link that toggles it and the setting are saved between page loads, that would be a bit trickier. Thoughts? –Novem Linguae (talk) 22:08, 14 June 2024 (UTC)Reply
I prefer a toggle, but I don't want to put you to extra work if my wish is not shared by others. BTW, there's something else I'd really like if you feel like tackling it. I don't know how hard it is. I want to be able to look at the contribution history of a page and see only the edits of blocked users. I've wished this for a while as it would help sometimes when I'm investigating a possible new sock.--Bbb23 (talk) 22:49, 14 June 2024 (UTC)Reply
@Bbb23. Here's some code to make UserHighlighterSimple only run on RFA subpages. You'd put this in your common.js (and also make sure to delete the old entry in common.js):
if ( mw.config.get( 'wgPageName' ).startsWith( 'Wikipedia:Requests_for_adminship/' ) ) {
	importScript('User:Novem Linguae/Scripts/UserHighlighterSimple.js');
}
I'm currently a little busy and I don't think I'll have time to work on a toggle or a "show only blocked users in contribs" script. For the second one, you might want to post at WP:US/R. Should be an hour or two to script up for someone experienced. Hope that helps! –Novem Linguae (talk) 14:30, 23 June 2024 (UTC)Reply
Thanks for the pointer to US/R.--Bbb23 (talk) 15:20, 23 June 2024 (UTC)Reply

Default colours in Docs

edit

Hey @Novem Linguae,

I recently started using your script, but wanted to change the colour admins look to yellow. However, customizing a single group, requires one to specify every group's colour and styling in the .css file. I took the code from the js file and changed it a bit to use it in my .css file. It would be beneficial if this default code can be put into the docs. Then one can just copy this, change the groups that they want to customize, and be done! Thanks!

.UHS-override-signature-colors {
   color: #0645ad !important;
   background-color: transparent !important;
   background: unset !important;
}

.UHS-no-permissions {
   border: 1px solid black !important;
}
.UHS-500edits-bot-trustedIP {
   background-color: lightgray !important;
}
.UHS-10000edits {
   background-color: #9c9 !important;
}
.UHS-new-page-reviewer {
   background-color: #99f !important;
}
.UHS-former-administrator {
   background-color: #d3ac8b !important;
}
.UHS-administrator {
   background-color: #9ff !important;
}
.UHS-bureaucrat {
   background-color: orange !important;
   color: #0645ad !important;
}
.UHS-arbitration-committee {
   background-color: #ff3f3f !important;
   color: white !important;
}
.UHS-steward {
   background-color: #00ff00 !important;
}
.UHS-wmf {
   background-color: hotpink !important;
   color: #0645ad !important;
}

Bunnypranav (talk) 11:32, 27 October 2024 (UTC)Reply

 DoneNovem Linguae (talk) 14:24, 27 October 2024 (UTC)Reply

User and false positive

edit

I don't know if this is a known bug, but the highlighting I setup for new users is being applied to articles. User, User (computing), User-centered design, User interface as examples. Not a major issue, just thought I'd report it. -- LCU ActivelyDisinterested «@» °∆t° 10:48, 22 April 2025 (UTC)Reply

 Done. Diff. Thanks for reporting. –Novem Linguae (talk) 03:22, 26 May 2025 (UTC)Reply

Bug - Script dies when url is invalid

edit

This happens in linksToAUser in urlHelper. Specifically in my case I discovered this bug while browsing ANI, the script stumbled upon this link: [http://Wikipedia:Requests%20for%20arbitration/Eastern%20Europe contentious topic] which it converts to: http://Wikipedia:Requests%20for%20arbitration/Eastern%20Europe

Which is invalid and produces this error in the console:

Uncaught (in promise) TypeError: Failed to construct 'URL': Invalid URL
    at UserHighlighterSimple.linksToAUser (userscript.html?name=UserHighlighterSimple.user.js&id=4c57bdcc-2a5f-43d3-9e38-2cd26e775776:157:21)
    at HTMLAnchorElement.<anonymous> (userscript.html?name=UserHighlighterSimple.user.js&id=4c57bdcc-2a5f-43d3-9e38-2cd26e775776:44:15)
    at jQuery.each (jquery.js:383:19)
    at jQuery.fn.init.each (jquery.js:205:17)
    at UserHighlighterSimple.execute (userscript.html?name=UserHighlighterSimple.user.js&id=4c57bdcc-2a5f-43d3-9e38-2cd26e775776:41:10)
    at async userscript.html?name=UserHighlighterSimple.user.js&id=4c57bdcc-2a5f-43d3-9e38-2cd26e775776:324:3

And afterwards the script stops highlighting all users after the link. Which you should be able to see by my name not being highlighted, while everyone above this section has some nice color in them.

I fixed this for me personally by putting urlHelper in a try-catch:

console.debug( `UserHighlighterSimple: Checking URL: ${url}` ); //temp to find which url is the problem
try {
	var urlHelper = new URL( url ); //changed from const otherwise it's not accessible outside the try
} catch ( e ) {
	// If the URL is not valid, skip it.
	console.warn( `UserHighlighterSimple: Invalid URL: ${url}`, e ); // temp for debugging 
	return false;
}

I rarely code in JS so I'm not confident if my method is the best in fixing this, but it's there. Trim02 (talk) 05:58, 25 May 2025 (UTC)Reply

Very nice bug report. Thanks for including all those details.  Done. Diff.Novem Linguae (talk) 03:15, 26 May 2025 (UTC)Reply

signature obscured by grey/500+ highlight

edit

@Novem Linguae or someone else who understands CSS, can you figure out why @LuniZunie's signature with text shadows is partially obscured by the grey highlight? (Ignore the green from Convenient Discussions, that was a red herring.) ClaudineChionh (she/her · talk · email · global) 03:02, 14 October 2025 (UTC)Reply

Sure, I can take a look. Can you please provide a link to that screenshot's original location so I can reproduce? –Novem Linguae (talk) 04:58, 21 October 2025 (UTC)Reply
Here's a new screenshot now that LuniZunie has been given the NPP right, taken from Special:GoToComment/c-LuniZunie-20251014154400-ClaudineChionh-20251014024800.
ClaudineChionh (she/her · talk · email · global) 05:18, 21 October 2025 (UTC)Reply
Thanks. It doesn't look easily fixable. I think CSS text-shadow just doesn't look great on non-white backgrounds. At least the text is visible unlike in that other screenshot! –Novem Linguae (talk) 05:32, 21 October 2025 (UTC)Reply
Actually, maybe I should just remove the text-shadow. Let me try that. One sec. –Novem Linguae (talk) 05:33, 21 October 2025 (UTC)Reply
Too hard. This particular signature isn't putting the text-shadow on the <a> tag. It's putting it on a <span> tag 2 levels above the <a> tag. Not worth coding up something so unusual. –Novem Linguae (talk) 05:38, 21 October 2025 (UTC)Reply
No worries, I know whose signature it is now, in any case (I don't think I've seen this issue in any other signatures). ClaudineChionh (she/her · talk · email · global) 05:41, 21 October 2025 (UTC)Reply
Bummer that it's unreadable in your screenshots. It is readable for me (but blurry) in Firefox on Windows 10. –Novem Linguae (talk) 05:45, 21 October 2025 (UTC)Reply
I hadn't even considered browser differences. These screenshots are from an iPad. ClaudineChionh (she/her · talk · email · global) 05:49, 21 October 2025 (UTC)Reply

WMF impersonator not blacklisted

edit

I was surprised to see a pink name at AIV. How did this get past the blacklist? ClaudineChionh (she/her · talk · email · global) 14:35, 9 April 2026 (UTC)Reply

The WMF anti-spoof rule RegEx is .*(WMF|WⅯF).* <newaccountonly|antispoof> and is located at https://meta.wikimedia.org/wiki/Title_blacklist. A quick test trying to register a name similar to the LTA you mentioned does display the proper warning message. So I am quite puzzled at how this user was able to register. Your user is named SuperPianoMan, The WMF, Asilvering, and Astrawiki, created their account on 06:30, 9 April 2026 (14 hours ago), and is now globally locked. Will ask some friends for help on this one -- maybe I'm missing something obvious. –Novem Linguae (talk) 03:55, 10 April 2026 (UTC)Reply

Topic bans

edit

Only tangential to this script, but would it be possible to create something similar that highlights users with topic bans? -- LCU ActivelyDisinterested «@» °∆t° 21:39, 15 April 2026 (UTC)Reply

@ActivelyDisinterested. Anything is possible with enough engineering time :)
To make this efficient to code, there'd need to be a master list of active topic bans somewhere. Do you know if such a page exists? –Novem Linguae (talk) 22:19, 15 April 2026 (UTC)Reply
(talk page stalker) Wikipedia:Editing restrictions has a list ~/Bunnypranav:<ping> 03:45, 16 April 2026 (UTC)Reply
That's a decent start. Would probably need a bot to convert that into a simple list of topic banned usernames in .json format and publish it somewhere. Then modify an appropriate user script or gadget (maybe MediaWiki:Gadget-markblocked.js?) to ingest the data and place a special marking on such a user. –Novem Linguae (talk) 07:21, 16 April 2026 (UTC)Reply