Wikipedia:User scripts/Requests
Post your user script-related request or idea for a new user script (or gadget) as a new section below. Discussion in each section is encouraged. Note that most gadgets started out as mere user scripts. This page is intended for new user scripts, which affect the appearance of the site and may add additional functionality. Fully automated bots should be requested at Wikipedia:Bot requests instead. All user script-related requests are welcome, whether they be for assistance writing an existing user script, desire for a new user script that does what you want, etc. Ideas for new user scripts are welcome too! Before you request a script, please make sure it does not already exist. For a list of user scripts, see this list. If you have been helped, please let us know, so that we may archive the request. |
|
Unknown parameters
[edit]Hi. Is there a gadget to detect unknown parameters in templates? Kind of like WP:WPCleaner does by parsing parameters in Template:Format TemplateData. GryffindorD (talk) 13:50, 21 July 2023 (UTC)
- Not a gadget, but Module:Check for unknown parameters is used in thousands of templates. It puts pages in a tracking category when they have unsupported parameters. – Jonesey95 (talk) 14:28, 22 July 2023 (UTC)
- @GryffindorD: I made a tool that sorts articles by use of template parameters. Among others it lists unknown parameters. I recently expanded it to work on other wikis too. You can access it by visiting this page. Lmk if you encounter any bugs. Ivi104 (talk) 01:52, 22 March 2024 (UTC)
Auto-expand V22 floating TOC subsections when the subsection's parent section is active
[edit]Something like the demo at mw:Skin:Vector/2022/Design documentation § 2) Why are sub-sections collapsed by default?. Aaron Liu (talk) 00:26, 20 December 2023 (UTC)
Auto-NOPIPE
[edit]Would it be possible to create a script that would identify unnecessary piped links and simplify them?
The advice given at WP:NOPIPE and MOS:NOPIPE is that piped links are to be avoided when a redirect exists that fits well into the context of the displayed text.
[[Wolfgang Amadeus Mozart|Mozart]]
![check](http://upload.wikimedia.org/wikipedia/en/thumb/f/fb/Yes_check.svg/15px-Yes_check.svg.png)
[[Mozart]]
What I'd like is a script that will scan an article for links of the first type and replace them with links of the second type: that is, where a link of the form [[A|B]]
can be replaced with a link of the form [[B]]
, where [[B]]
is a valid pre-existing redirect to [[A]]
, or where both [[A]]
and [[B]]
redirect to some other page [[C]]
.
Jean-de-Nivelle (talk) 11:48, 26 December 2023 (UTC)
- User:Nardog/Unpipe.js. It's kind of a proof of concept and it might be overeager at replacing links. Nardog (talk) 05:00, 2 January 2024 (UTC)
Sortkeys in lists
[edit]I recently went through an article that has a list of organizations and added sortkeys so that all the ones with "the" in their name didn't sort alphabetically by T. It wasn't quite a long enough list to be worth composing a RegEx find and replace to do the whole thing automatically, but it strikes me as a common enough situation that it might be helpful to have a script that can do it. {{u|Sdkb}} talk 15:40, 12 January 2024 (UTC)
- Could you provide the RegEx? That’s sort of what Wikipedia:AutoEd does: regex find and replaces. We could write an AutoEd module with it. Aaron Liu (talk) 17:01, 12 January 2024 (UTC)
- The RegEx query for the find part would be something like
\| The \[\[(\w*)
, and the replace part would be something like\| data-sort-value="$1" \| The \[\[$1
. There would be another find-and-replace for instances in which thethe
is within the link:\| \[\[The (\w*)
→\| data-sort-value="$1" \| \[\[The $1
. Cheers, {{u|Sdkb}} talk 23:42, 12 January 2024 (UTC)- @Sdkb User:Aaron Liu/SortKeyDeThe.js now does this, though it won't do things if the relevant entry isn't at the start of its line to eliminate some false positives.Also, I seem to have misread you, sorry. I thought you said that you already had a regex :p Aaron Liu (talk) 02:52, 14 January 2024 (UTC)
- The RegEx query for the find part would be something like
- Maybe a
data-sort-type="..."
could be created for this form of alphabetical sorting? See: - Help:Sortable tables#Forcing a column to have a particular data type
data-sort-type=text
- alphabetical sort of a table column.data-sort-type=the
- alphabetical sort of a table column. Along with ignoring "the" in front.- I guess it would be a feature request at Phabricator.
- --Timeshifter (talk) 18:01, 12 January 2024 (UTC)
Wikilink suggestions on a given page
[edit]Hello, I was suggested by @Tamzin on the discord to post this here, basically the inverse to User:Edward/Find_link, where instead of finding pages that could be linked to a given page, it instead finds pages that could be linked with the current text on the article. There are two different methods i can think of achieving this, either by basically making a permutation set/concordance of the article's text against title search, or just taking the categories/wikiprojects that a page belongs to and checking the articles titles on those categories/wikiprojects to see if they match text on the given page. there's pros and cons to both methods and the best would be able to implement both and automatically use one method or another given on whatever is considered less expensive computationally, or at least letting the user decide which method they'd like to use for a given search. Akaibu (talk) 14:37, 12 February 2024 (UTC)
- In my opinion, this isn't a very good idea. Linking should be done when something isn't very understandable by most people, which is an easy enough criteria for people to manually do drive-by links. Aaron Liu (talk) 22:32, 27 February 2024 (UTC)
Increased Watchlist size
[edit]I watch many (currently 3,044 articles), meaning the 1,000 changes, 30 day limit can be annoying sometimes. Could there be a script created to allow for an increase? Thanks. Kew Gardens 613 (talk) 07:27, 16 February 2024 (UTC)
- You can't change this with a user script. I just tested https://en.wikipedia.org/w/index.php?hidemyself=1&hidebots=1&hidecategorization=1&hideWikibase=1&limit=2000&days=30&enhanced=1&title=Special:Watchlist&urlversion=2 (note the limit=2000), and the MediaWiki software silently changes it back to 1000. There's a hard-coded limit in MediaWiki somewhere. You will probably want to subscribe to and post in phab:T151165. –Novem Linguae (talk) 07:46, 16 February 2024 (UTC)
- That links does show 2,000 changes if you use the non-JavaScript interface. Nardog (talk) 23:54, 27 February 2024 (UTC)
Script to show move-protection lock?
[edit]I couldn't find anything from a search through the list, and I've tried to engineer one myself but I'm not exactly sure where to start, but essentially I want to display the move-protection lock icon on my side when I view pages with move protection (but no edit protection). The icon itself was removed from displaying on most reader-visible pages since it means nothing to a reader, but I still find myself wanting to quickly be able to glance at the top and see that a page is protected in some way. EggRoll97 (talk) 20:20, 4 March 2024 (UTC)
- I've made User:Aaron Liu/MoveTop.js, though it currently disregards whether the page is protected from editing and adds the padlock regardless, which would display alongside the other padlock. Aaron Liu (talk) 03:34, 5 March 2024 (UTC)
- Thanks, that's amazing! EggRoll97 (talk) 06:07, 5 March 2024 (UTC)
Would it be possible to create a script that would delink repeated links, as well as one that would be able to find the first mention of a phrase matching the title of a link further in the article, linking that and delinking all subsequent links to that title? ‑‑Neveselbert (talk · contribs · email) 20:17, 8 March 2024 (UTC)
- That would be very hard. Just highlighting duplinks (or using my fork of it) would be enough. Aaron Liu (talk) 23:26, 8 March 2024 (UTC)
- @Aaron Liu: yes, I've been using that, it just takes a lot of time, especially in cases where the first mention of a phrase isn't linked but a later one has been. I'd have thought it possible to create a script to make a note of all links duplicated (by virtue of your script), and search the article for all exact matches of linked article titles, linking the first mention, then delinking those subsequent. @Nardog: do you think this could work? Thanks all, ‑‑Neveselbert (talk · contribs · email) 15:10, 9 March 2024 (UTC)
- It is possible, but I think that'd result in too many false positives. Often a phrase isn't stated exactly the same as the article title, so the actual first mention would be delinked.
Just the automatic delinking part would be possible, though it'd be much more complicated if we needed to follow redirects. Aaron Liu (talk) 16:08, 9 March 2024 (UTC)- Yes, I thought about that, though I know that I would double-check the edit to make sure there were no false positives. I think following a redirect could be considered eventually, but for the moment, I think the script should just focus on exact matches to avoid any of these false positives, so if the phrase matches the title exactly, it's delinked. ‑‑Neveselbert (talk · contribs · email) 16:10, 9 March 2024 (UTC)
- WP:LINKFIRST permits repeated links where helpful, and writing a script that determines whether something is helpful seems like an AI-hard problem. That said, I've seen articles that are absurdly overlinked, linking the same word repeatedly in a single sentence. Fixing was tedious; I think I've removed the lot with find/replace and then manually inserted a sane number of links, at least once.
- Duplinks already ignores some links on the basis of placement. Using different colours to highlight, say the first and subsequent repeats of each link per major section, and say, links in lists, captions or tables where they duplicate the body text, would be doable. Would that help winnow down to the links that are most likely to be unhelpful? Then maybe one could look at the patterns, and decide, say, to remove all orange-highlighted links in the article automatically. Making this work for colourblind users might require a bit of extra effort. HLHJ (talk) 14:59, 24 May 2024 (UTC)
- Yes, I thought about that, though I know that I would double-check the edit to make sure there were no false positives. I think following a redirect could be considered eventually, but for the moment, I think the script should just focus on exact matches to avoid any of these false positives, so if the phrase matches the title exactly, it's delinked. ‑‑Neveselbert (talk · contribs · email) 16:10, 9 March 2024 (UTC)
- It is possible, but I think that'd result in too many false positives. Often a phrase isn't stated exactly the same as the article title, so the actual first mention would be delinked.
- @Aaron Liu: yes, I've been using that, it just takes a lot of time, especially in cases where the first mention of a phrase isn't linked but a later one has been. I'd have thought it possible to create a script to make a note of all links duplicated (by virtue of your script), and search the article for all exact matches of linked article titles, linking the first mention, then delinking those subsequent. @Nardog: do you think this could work? Thanks all, ‑‑Neveselbert (talk · contribs · email) 15:10, 9 March 2024 (UTC)
WikiDefcon User Script
[edit]I'm requesting a user script that adds a WikiDefcon marker to the top bar for Vector 2022, ideally placed next to the notifications/alerts tabs using Template:Vandalism information. This would assist greatly in counter-vandalism tasks. Possibly, it could use these images, similar to the relevant topicon. Thanks,NeuropolTalk 15:37, 2 April 2024 (UTC)
- @Neuropol: Hi. I'm working on it. Can you please choose a target page for when we click on the icon? Thanks. Jeeputer Talk 16:15, 2 April 2024 (UTC)
- Hi, Template:Vandalism information would fit most consistently with other WikiDefcon templates. Thanks,NeuropolTalk 16:17, 2 April 2024 (UTC)
- @Neuropol: Ok it's done and ready to use: User:Jeeputer/defconIndicator.js. If you click on the icon, it will update the image used to show the current level of vandalism. the script itself updates the icon every 2 minutes. I can change the interval if it's too fast. Jeeputer Talk 19:30, 2 April 2024 (UTC)
- Works great. Thank you so much! Thanks,NeuropolTalk 22:17, 2 April 2024 (UTC)
- @Neuropol: Ok it's done and ready to use: User:Jeeputer/defconIndicator.js. If you click on the icon, it will update the image used to show the current level of vandalism. the script itself updates the icon every 2 minutes. I can change the interval if it's too fast. Jeeputer Talk 19:30, 2 April 2024 (UTC)
- Hi, Template:Vandalism information would fit most consistently with other WikiDefcon templates. Thanks,NeuropolTalk 16:17, 2 April 2024 (UTC)
Customizable toolbar image + link
[edit]I'm not sure how possible this is, but it would be really nice to have a user script which adds a new icon to the top toolbar (where one's username is, notifications, watchlist, etc.) which could be customized using custom images + a custom link which it leads to. Thanks,NeuropolTalk 12:48, 10 May 2024 (UTC)
- This sounds feasible as it's just a portlet, but you may have to specify the link to the image yourself. Also, I'm assuming you don't want it to sticky. Aaron Liu (talk) 12:59, 10 May 2024 (UTC)
- Sounds reasonable. Forgive my coding illiteracy, but what does it mean to be "sticky"? Thanks,NeuropolTalk 13:00, 10 May 2024 (UTC)
- In V22, a different top bar becomes sticky and stays at the top while you scroll down. Aaron Liu (talk) 13:18, 10 May 2024 (UTC)
- Yeah, not sticky then please. Thanks,NeuropolTalk 13:19, 10 May 2024 (UTC)
- You can add a link that takes you to a page of your choice. See the "Add links at top for Tools page" section of User:Jonesey95/vector-2022.js. This makes a "Tools" link appear between "Sandbox" and "Preferences" for me. It's not an icon, but it is there any time I need it, on every page (after making the top bar sticky on all pages, of course). – Jonesey95 (talk) 20:36, 11 May 2024 (UTC)
- Yeah, not sticky then please. Thanks,NeuropolTalk 13:19, 10 May 2024 (UTC)
- In V22, a different top bar becomes sticky and stays at the top while you scroll down. Aaron Liu (talk) 13:18, 10 May 2024 (UTC)
- Sounds reasonable. Forgive my coding illiteracy, but what does it mean to be "sticky"? Thanks,NeuropolTalk 13:00, 10 May 2024 (UTC)
- @Neuropol I've just noticed User:BrandonXLF/PortletLinks. Would that work? Aaron Liu (talk) 14:23, 4 August 2024 (UTC)
Script to quickly answer {{Help me}}
[edit]Can be fully based on edit request user scripts, like this one. Thoughts? Cocobb8 (💬 talk • ✏️ contribs) 22:55, 29 May 2024 (UTC)
- Finally, my chance! Cocobb8, I could probably do that. Any preferences you would like me to know? — thetechie@enwiki: ~/talk/ $ 23:56, 29 May 2024 (UTC)
- @TheTechie Thanks so much! By preferences, do you mean settings or what I would prefer? Cocobb8 (💬 talk • ✏️ contribs) 01:15, 30 May 2024 (UTC)
- Cocobb8, the latter, if anything. — thetechie@enwiki: ~/talk/ $ 01:21, 30 May 2024 (UTC)
- @TheTechie Just a simple "respond" button with then additional buttons to select the template to change it to is all I would like to have :). Thanks so much for taking this one so quickly!! Cocobb8 (💬 talk • ✏️ contribs) 01:24, 30 May 2024 (UTC)
- @TheTechie I don't mean to rush things at all, but I was just wondering what would be an estimated date for you to complete this script? Thanks so much! Cocobb8 (💬 talk • ✏️ contribs) 13:12, 6 June 2024 (UTC)
- Not sure, kind of busy whilst trying to figure out an issue with the script and if it is possible (I'm trying to change the respond button to work for "help me" but the script has no comments, so some things are kind of obfuscated, per se). @Cocobb8 thetechie@enwiki: ~/talk/ $ 14:17, 6 June 2024 (UTC)
- Hey @TheTechie, I was wondering if you had tested the script in Vector 2022? I use that as my skin and I can't see the button. Cheers! Cocobb8 (💬 talk • ✏️ contribs) 21:46, 25 July 2024 (UTC)
- Hello,
- No, I haven't had the chance to test it on testwiki due to CORS restrictions. It should target all "helpme"s, let me know if it doesn't. thetechie@enwiki: ~/talk/ $ 01:16, 29 July 2024 (UTC)
- I put one up at User talk:Aaron Liu/sandbox#Introduction to contentious topics and it didn't seem to do anything at all. Aaron Liu (talk) 03:11, 1 August 2024 (UTC)
- Hey @TheTechie, I was wondering if you had tested the script in Vector 2022? I use that as my skin and I can't see the button. Cheers! Cocobb8 (💬 talk • ✏️ contribs) 21:46, 25 July 2024 (UTC)
- Not sure, kind of busy whilst trying to figure out an issue with the script and if it is possible (I'm trying to change the respond button to work for "help me" but the script has no comments, so some things are kind of obfuscated, per se). @Cocobb8 thetechie@enwiki: ~/talk/ $ 14:17, 6 June 2024 (UTC)
- @TheTechie I don't mean to rush things at all, but I was just wondering what would be an estimated date for you to complete this script? Thanks so much! Cocobb8 (💬 talk • ✏️ contribs) 13:12, 6 June 2024 (UTC)
- @TheTechie Just a simple "respond" button with then additional buttons to select the template to change it to is all I would like to have :). Thanks so much for taking this one so quickly!! Cocobb8 (💬 talk • ✏️ contribs) 01:24, 30 May 2024 (UTC)
- Cocobb8, the latter, if anything. — thetechie@enwiki: ~/talk/ $ 01:21, 30 May 2024 (UTC)
- @TheTechie Thanks so much! By preferences, do you mean settings or what I would prefer? Cocobb8 (💬 talk • ✏️ contribs) 01:15, 30 May 2024 (UTC)
Collapsible parentheses in body text
[edit]Hi, not sure where this is going or how feasable but :
- I've always been startled at how readable software editors make sources look in comparison to regular text.
- I love the peek feature on wiki's internal links.
- Tough subjects might use a lot of optional brackets to refine composed sentences (actually it could be just bad use of brackets too).
So here are my dirty ideas :
- plan A : Make brackets and their contained text coloured in a randomized dark-grey-color-tinted scheme (sane idea right?).
- plan B : Make brackets collapsable.
- plan Z : Go way beyond and rock every non-software english enthusiast by forcing natural english syntax colouring down their throat.
Plan Z though, is not on topic, plan A and B are. Good friends, what does that inspire you? Is it a good thing to pursue?
Much appreciation. Toto4040 (talk) 09:25, 4 June 2024 (UTC)
- I wonder if that syntax highlighter is Open-source software. If it were suitably licensed and happened to be written in Javascript, you could run it as a Wikipedia:User scripts in your own account. WhatamIdoing (talk) 16:50, 4 June 2024 (UTC)
- Just something to consider: Some brackets aren't expressing a standalone idea, so coloring them differently might be confusing (for instance, "Janet(s)" or SO(3)). RunningTiger123 (talk) 01:10, 6 June 2024 (UTC)
- Would be easy to only detect them with a preceding space. Aaron Liu (talk) 12:54, 7 June 2024 (UTC)
Fork of Enterprisey's revdel script
[edit]Hey all! Would anyone be willing to fork Enterprisey's copyvio-revdel user script? There is an issue with it on Vector 2022, where the "Range?" checkbox does not show. Cheers! Cocobb8 (💬 talk • ✏️ contribs) 22:33, 6 June 2024 (UTC)
- Works for me. I'd agree that it has kinda bad UI design I dunno how to fix though. You have to click the blue button to add the range. Aaron Liu (talk) 23:06, 6 June 2024 (UTC)
- The checkbox appears for me on Vector 2022. Is there a specific page or revision range this is an issue on? Chlod (say hi!) 01:53, 7 June 2024 (UTC)
- @Chlod, @Aaron Liu Here's what I see: https://pasteboard.co/ALyP3BB2B8TH.png. Am I missing anything? Cocobb8 (💬 talk • ✏️ contribs) 12:58, 7 June 2024 (UTC)
- @Cocobb8: You first have to add a range of diffs before that table gets populated. See the first paragraph of User:Enterprisey/cv-revdel § Usage for more details. Chlod (say hi!) 13:05, 7 June 2024 (UTC)
- Got it. So sorry about that, I hadn't bothered to see if that would do anything. Thanks so much! Cocobb8 (💬 talk • ✏️ contribs) 13:10, 7 June 2024 (UTC)
- @Cocobb8: You first have to add a range of diffs before that table gets populated. See the first paragraph of User:Enterprisey/cv-revdel § Usage for more details. Chlod (say hi!) 13:05, 7 June 2024 (UTC)
- @Chlod, @Aaron Liu Here's what I see: https://pasteboard.co/ALyP3BB2B8TH.png. Am I missing anything? Cocobb8 (💬 talk • ✏️ contribs) 12:58, 7 June 2024 (UTC)
Sentence/title case
[edit]Hi! Do you think a script could be made that looks for |title= within references, and then changes everything inside it to either title case or sentence case? Lee Vilenski (talk • contribs) 12:43, 7 June 2024 (UTC)
- It would be possible, but I thought titles of sources were supposed to be capitalized as the source capitalizes it. Aaron Liu (talk) 12:50, 7 June 2024 (UTC)
- For all-capital titles, MOS:ALLCAPS would apply (I'm guessing this is what the script is meant to fix). More limited capitalization may be different. RunningTiger123 (talk) 02:41, 8 June 2024 (UTC)
- Yeah, but it sounds it'll also convert stuff that isn't all-caps. Aaron Liu (talk) 17:29, 8 June 2024 (UTC)
- @ZKang123 made User:ZKang123/Titlecaseconverter.js the other day. You run it by going to edit source, then clicking a link in the tools menu, then clicking "Show changes". –Novem Linguae (talk) 17:52, 8 June 2024 (UTC)
- A link provided there satisfies my question. It's outlined under MOS:CONFORM. Aaron Liu (talk) 18:36, 8 June 2024 (UTC)
- Thanks for that, sounds like ZKang was well ahead of me. :) Lee Vilenski (talk • contribs) 18:50, 8 June 2024 (UTC)
- A link provided there satisfies my question. It's outlined under MOS:CONFORM. Aaron Liu (talk) 18:36, 8 June 2024 (UTC)
- @ZKang123 made User:ZKang123/Titlecaseconverter.js the other day. You run it by going to edit source, then clicking a link in the tools menu, then clicking "Show changes". –Novem Linguae (talk) 17:52, 8 June 2024 (UTC)
- Yeah, but it sounds it'll also convert stuff that isn't all-caps. Aaron Liu (talk) 17:29, 8 June 2024 (UTC)
- For all-capital titles, MOS:ALLCAPS would apply (I'm guessing this is what the script is meant to fix). More limited capitalization may be different. RunningTiger123 (talk) 02:41, 8 June 2024 (UTC)
DYK Reviewer tool
[edit]Following this discussion, can someone please write a DYK reviewer tool. dxneo (talk) 13:39, 13 June 2024 (UTC)
- Got a link to the steps? –Novem Linguae (talk) 13:51, 13 June 2024 (UTC)
- @Novem Linguae: Hi. User:Nightdevil has a script for this purpose on fawiki (fa:User:Nightdevil/amikCloser.js). Maybe it can help writing a script for enwiki. I don't know if the procedure for DYK reviewing on this wiki is the same. Jeeputer Talk 13:23, 14 June 2024 (UTC)
Show only blocked users
[edit]See User talk:Novem Linguae/Scripts/UserHighlighterSimple#Toggle. As I stated to Novem Linguae, I'd like "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." I didn't know this page existed until they recommended I come here. Thanks.--Bbb23 (talk) 15:14, 23 June 2024 (UTC)
- @Bbb23, if you have the Strike out usernames that have been blocked gadget enabled, this could be as easy as running
$("li[data-mw-revid]").hide().has("a.user-blocked-indef, a.user-blocked-partial, a.user-blocked-temp").show()
- from your browser console (in Firefox: right click anywhere on article history page > inspect > console tab).
- The code simply hides the unblocked user contributions, so it will only show blocked users that were originally on the history page (a fraction of the last 500 edits should suffice, I assume). Ponor (talk) 08:28, 26 June 2024 (UTC)
- @Ponor: I get to console tab and paste in your code to the box called "Filter output". Nothing changes in the contribution history. I'm using Bapaiya as it has a lot of blocked users. What am I doing wrong? --Bbb23 (talk) 13:10, 26 June 2024 (UTC)
- What skin are you using? –Novem Linguae (talk) 13:12, 26 June 2024 (UTC)
- Vector legacy.--Bbb23 (talk) 13:15, 26 June 2024 (UTC)
- Link to your test page: https://en.wikipedia.org/w/index.php?title=Bahuchara_Mata&action=history&useskin=vector. It works for me, with one caveat: if the edit summary includes a wikilink that mentions a blocked user, then that edit summary will also be included, even if the user is not blocked. For example, JalenFolf is not blocked, but he reverted an edit by blocked user Harihar Rawal, so that edit is included. Ponor could probably fix this by adding
.history-user
somewhere in the code above. –Novem Linguae (talk) 13:42, 26 June 2024 (UTC)- Oh, yes. Thanks, didn't have that case on the pages where I tested. So it's:
$("li[data-mw-revid]").hide().has(".history-user > a.user-blocked-partial, .history-user > a.user-blocked-indef, .history-user > a.user-blocked-temp").show()
Ponor (talk) 14:02, 26 June 2024 (UTC)
- Link to your test page: https://en.wikipedia.org/w/index.php?title=Bahuchara_Mata&action=history&useskin=vector. It works for me, with one caveat: if the edit summary includes a wikilink that mentions a blocked user, then that edit summary will also be included, even if the user is not blocked. For example, JalenFolf is not blocked, but he reverted an edit by blocked user Harihar Rawal, so that edit is included. Ponor could probably fix this by adding
- Vector legacy.--Bbb23 (talk) 13:15, 26 June 2024 (UTC)
- @Bbb23, it's not the "Filter output" field. There should be a prompt at the bottom of that window, i.e. console tab, where you can execute any code. This should be skin independent.
- I've checked here [1] and it worked. Ponor (talk) 13:20, 26 June 2024 (UTC)
- @Ponor: I don't see a "prompt".--Bbb23 (talk) 13:23, 26 June 2024 (UTC)
- @Bbb23 browser console, section "#Browser Console command line". Ponor (talk) 13:25, 26 June 2024 (UTC)
- All of these things you're recommending are for FF developers, which I am not. I went a little deeper based on your link above, but I had to change developer settings, which I believe I did, and I still couldn't make the thing work. I'll wait for someone to come up with a simpler Wikipedia-based solution. If not, I'll live. Thanks for trying to help.--Bbb23 (talk) 13:45, 26 June 2024 (UTC)
- @Bbb23. Try this: User:Novem Linguae/Scripts/BlockedUserHistory.js. To activate, go to more menu -> "Show only blocked users". With thanks to Ponor for the above JQuery code. –Novem Linguae (talk) 14:14, 26 June 2024 (UTC)
- All of these things you're recommending are for FF developers, which I am not. I went a little deeper based on your link above, but I had to change developer settings, which I believe I did, and I still couldn't make the thing work. I'll wait for someone to come up with a simpler Wikipedia-based solution. If not, I'll live. Thanks for trying to help.--Bbb23 (talk) 13:45, 26 June 2024 (UTC)
- @Bbb23 browser console, section "#Browser Console command line". Ponor (talk) 13:25, 26 June 2024 (UTC)
- @Ponor: I don't see a "prompt".--Bbb23 (talk) 13:23, 26 June 2024 (UTC)
- What skin are you using? –Novem Linguae (talk) 13:12, 26 June 2024 (UTC)
- @Ponor: I get to console tab and paste in your code to the box called "Filter output". Nothing changes in the contribution history. I'm using Bapaiya as it has a lot of blocked users. What am I doing wrong? --Bbb23 (talk) 13:10, 26 June 2024 (UTC)
I was gonna ask you to add
var node = mw.util.addPortletLink('p-tb', '', 'Show only blocked');
$( node ).on( 'click', function ( e ) {
$("li[data-mw-revid]").hide().has(".history-user > a.user-blocked-partial, .history-user > a.user-blocked-indef, .history-user > a.user-blocked-temp").show();
e.preventDefault();
} );
to your Special:MyPage/common.js, but Novem Linguae was faster and his script targets only history pages, unlike mine. Ponor (talk) 14:23, 26 June 2024 (UTC)
- @Ponor: Thanks for your persistence. Novem Linguae, your script is perfect! --Bbb23 (talk) 14:52, 26 June 2024 (UTC)
Get the rename history of a page
[edit]There is one workflow that is absolutely not automated on Wikimedia sites: getting the rename history of a page. Digging through page logs looking for renaming records, especially when an article was renamed multiple times, often in a back and forth way, is terrible. A tool for that would be very helpful. Let's say, just a timeline with rename dates and new names.
Not necessarily should be a user script. Jack who built the house (talk) 22:12, 2 July 2024 (UTC)
- ...Turns out I wasn't searching hard enough, there is User:Nardog/MoveHistory! Jack who built the house (talk) 00:17, 3 July 2024 (UTC)
Mobile edit preview
[edit](See Wikipedia:Village pump (idea lab)#Formatting for mobile phones)
75% of Wikipedia traffic is from mobile devices. Editors using a desktop device should be able to see how their version of a page will look on a mobile device before saving it. This is to request a version of the Mobile sidebar preview widget that will show how the contents of the current edit window will look on a mobile device. Or, if this is simpler, for the existing Mobile sidebar preview widget to be enhanced so it works in edit mode, where it will display a mobile preview of the contents of the edit window. At some point, once fully tested and stable, it could be launched from the edit menu:
Pinging Brooke Vibber for comments. Aymatth2 (talk) 13:19, 3 July 2024 (UTC)
Script to show non-printing characters in edit fields
[edit]Is there a script that can show non-printing characters in edit fields? For example, Notepad++ can display many of these characters as black boxes with an abbreviation of the character's name (see e.g. File:Keylogger-software-logfile-example.jpg, which shows the BS character). In my quick testing, it appears that the C0 control codes do not survive a round-trip through the MediaWiki parser, but other non-printing characters do, and these characters show up surprisingly commonly in wikitext (the biggest offenders I've noticed are left-to-right marks and right-to-left marks, though I've come across a variety of them). Bonus points if the script can somehow distinguish various whitespace characters. 「ディノ奴千?!」☎ Dinoguy1000 12:58, 4 July 2024 (UTC)
- The default syntax highlighter appears to show them. Nardog (talk) 04:15, 7 July 2024 (UTC)
Script to set template parameter aliases
[edit]Many wikis are using templates originally created on English Wikipedia. On my home wiki, we set Persian aliases for templates' parameters, but it's a long and time-consuming process for large templates like most of the infoboxes. I can really use any help for creating a script to easily set aliases for existing parameters. I've tried to start wriiting it here but got stuck as I am not a Javascript expert. Any help is really appreciated. Jeeputer Talk 22:46, 6 July 2024 (UTC)
- I sacrificed my sleep for the noble act of creating User:Aaron Liu/AliasPam.js with AutoEd's framework. Tell me if you find any bugs. Aaron Liu (talk) 05:21, 9 July 2024 (UTC)
- @Aaron Liu: Thank you, I really appreciate your work! I will test it on fawiki and will give feedback. Jeeputer Talk 05:33, 9 July 2024 (UTC)
- @Aaron Liu: Can we use
mw.loader.load()
instead ofimportScript
to load AutoEd?importScript
tries to load "Wikipedia:AutoEd/core.js" from fawiki, which does not exist there, so... I get an error in my console when loading the script from enwiki. Jeeputer Talk 05:49, 9 July 2024 (UTC)- @Jeeputer
Done Aaron Liu (talk) 12:38, 9 July 2024 (UTC)
- @Aaron LiuThanks again. It works fine now. Jeeputer Talk 14:20, 9 July 2024 (UTC)
- @Jeeputer
Bit of help with seeing all edit filters
[edit]I don't think this exists as a script currently, but I was trying to view all edit filters using a user script to add a portlet to p-views. I've sort of started on it at User:EggRoll97/ExpandFilterView.js, and I've got a portlet to actually appear, but the problem I'm running into is that when I click the portlet, it goes to the desired link, but changes the link. Instead of going to Special:AbuseFilter/?deletedfilters=show&querypattern=&limit=5000
the portlet link goes to Special:AbuseFilter/%3Fdeletedfilters%3Dshow%26querypattern%3D%26limit%3D5000
, which causes the page to only show the default amount of filters, instead of all 5000. Does anyone possibly have suggestions on what I might be missing? I've checked the guide, but I'm not seeing anything that might explain it. The other question I had was if it's possible to only have this portlet appear on Special:AbuseFilter, and to hide itself on other pages. EggRoll97 (talk) 07:35, 20 July 2024 (UTC)
mw.util.getUrl( 'Special:AbuseFilter/', { deletedfilters: 'show', querypattern: '', limit: '5000' } )
. Or you can just write'/w/index.php?title=Special:AbuseFilter/&deletedfilters=show&querypattern=&limit=5000'
in place of getUrl(). Nardog (talk) 08:27, 20 July 2024 (UTC)- @EggRoll97: In response to your second question, use
if (mw.config.get('wgPageName') !== 'Special:AbuseFilter') return
. see doc. Jeeputer Talk 15:03, 20 July 2024 (UTC)- @Nardog and Jeeputer: Thanks! That does seem to fix the link problem, though I've tried the solution to the second question and it doesn't seem to be appearing on any page. I commented it out for now, but I'm not sure if I'm putting it in wrong. EggRoll97 (talk) 20:02, 20 July 2024 (UTC)
- Uncomment it, remove
return
and change!==
to===
.return
doesn't work because imported scripts execute in the global scope. Nardog (talk) 05:54, 21 July 2024 (UTC)- So, use this:
if (mw.config.get('wgPageName') === 'Special:AbuseFilter') { mw.util.addPortletLink ( 'p-views', mw.util.getUrl( 'Special:AbuseFilter/', { deletedfilters: 'show', querypattern: '', limit: '5000' } ), 'Edit Filters', 'pt-expandedfilters', 'View all filters'); }
- Jeeputer Talk 19:05, 21 July 2024 (UTC)
- Uncomment it, remove
- @Nardog and Jeeputer: Thanks! That does seem to fix the link problem, though I've tried the solution to the second question and it doesn't seem to be appearing on any page. I commented it out for now, but I'm not sure if I'm putting it in wrong. EggRoll97 (talk) 20:02, 20 July 2024 (UTC)
- This worked! Thanks to both! EggRoll97 (talk) 00:09, 22 July 2024 (UTC)
Fill sfn-ref page numbers
[edit]A script that allows you to click on sfn-refs and add/change page numbers — something like User:Ingenuity/ReferenceEditor.js, @DaxServer, FYI. TrangaBellam (talk) 10:12, 7 August 2024 (UTC)
Hello, the editor of this script has been retired for a long time. The script has an issue. While it includes a clear settings
button, it lacks a confirmation box . Many times, I’ve accidentally clicked the clear settings
button and lost my settings. Could someone please edit the script to add a confirmation box ? — Saqib (talk I contribs) 16:57, 15 August 2024 (UTC)
- Precedent is to not edit userscripts unless they have a bug even if the user's been inactive. Thankfully, the script exposes every function globally. That means you can append the following to your common.js (probably after the part that loads the smart watchlist script) to work your magic:Also, why not use the new JS interface? Aaron Liu (talk) 23:48, 15 August 2024 (UTC)
SmartWatchlist.clearSettings = function () { if ( confirm( "Clear all of your settings?" ) ) { clearSettings.apply(this, arguments); } };
- Aaron Liu, Thanks for your prompt help. Could you please check this if I’ve done it right, or let me know if I need to add it at line # 269 before I proceed with testing? And what is new JS interface? — Saqib (talk I contribs) 08:09, 16 August 2024 (UTC)
- Erm, you're supposed to install scripts with importScript() (which will always fetch the latest versions) instead of copy-pasting it. But yeah, it should work.Nevermind my comment about the JS interface. I personally couldn't get the script to work even without the changes unless I selected "use non-JS interface". Aaron Liu (talk) 12:36, 16 August 2024 (UTC)
- Aaron Liu, You’re right. But If I had installed this with importScript, I wouldn’t be able to make the above changes to it, correct? — Saqib (talk I contribs) 13:17, 16 August 2024 (UTC)
- Yes you would. Like I said, the script exposes some functions so we could simply place the part I made after the importScript and it’ll work. Aaron Liu (talk) 14:29, 16 August 2024 (UTC)
- Aaron Liu, You’re right. But If I had installed this with importScript, I wouldn’t be able to make the above changes to it, correct? — Saqib (talk I contribs) 13:17, 16 August 2024 (UTC)
- Erm, you're supposed to install scripts with importScript() (which will always fetch the latest versions) instead of copy-pasting it. But yeah, it should work.Nevermind my comment about the JS interface. I personally couldn't get the script to work even without the changes unless I selected "use non-JS interface". Aaron Liu (talk) 12:36, 16 August 2024 (UTC)
- This seems flawed in two ways: it would result in a ReferenceError because the global
SmartWatchlist
doesn't exist until the external script is loaded, which is asynchronous; andclearSettings
is not a global so another ReferenceError when the new function actually runs. So you'd have to do something like:Nardog (talk) 01:34, 17 August 2024 (UTC)mw.loader.getScript('/w/index.php?title=User:UncleDouggie/smart_watchlist.js&action=raw&ctype=text/javascript').then(function () { var clearSettings = SmartWatchlist.clearSettings; SmartWatchlist.clearSettings = function () { if ( confirm( "Clear all of your settings?" ) ) { clearSettings.apply(this, arguments); } }; });
- Fair. It works on my machine though :) Aaron Liu (talk) 01:47, 17 August 2024 (UTC)
- Aaron Liu, Thanks for your prompt help. Could you please check this if I’ve done it right, or let me know if I need to add it at line # 269 before I proceed with testing? And what is new JS interface? — Saqib (talk I contribs) 08:09, 16 August 2024 (UTC)
Unclutter script broken
[edit]The signature minimisation feature is broken in this script due to updates by Krinkle to MediaWiki this year and I am unable to contact the author due to their four year inactivity and the MW dev is unresponsive. 1989 (talk) 15:11, 18 August 2024 (UTC)
- @1989 Which update? And, how does the breakage manifest in this script? Krinkle (talk) 18:47, 18 August 2024 (UTC)
- My guess is the linking of timestamps, which stops the script from detecting signatures. Aaron Liu (talk) 20:26, 18 August 2024 (UTC)
- That seems to be what is the cause. I ran into a page where the timestamp link doesn’t work, and the user script is able to work. @Krinkle: Is there a script that can optionally disable that? 1989 (talk) 21:53, 18 August 2024 (UTC)
- It's never a good idea to use something that's not going to be updated much. Like I said, I'd recommend Convenient Discussions (the JWBTH/CD link below). Aaron Liu (talk) 22:24, 18 August 2024 (UTC)
- What you’ve suggested is unfortunately not a solution for me. 1989 (talk) 23:31, 18 August 2024 (UTC)
- It's never a good idea to use something that's not going to be updated much. Like I said, I'd recommend Convenient Discussions (the JWBTH/CD link below). Aaron Liu (talk) 22:24, 18 August 2024 (UTC)
- That seems to be what is the cause. I ran into a page where the timestamp link doesn’t work, and the user script is able to work. @Krinkle: Is there a script that can optionally disable that? 1989 (talk) 21:53, 18 August 2024 (UTC)
- My guess is the linking of timestamps, which stops the script from detecting signatures. Aaron Liu (talk) 20:26, 18 August 2024 (UTC)
- I would recommend c:User:JWBTH/CD in the toggleable Flow-like interface combined with WP:POPUPS. Aaron Liu (talk) 20:27, 18 August 2024 (UTC)
Auto-open Wikidata item
[edit]I work on Category:Articles missing coordinates with coordinates on Wikidata in bulk occasionally, and a tool that would speed up the process a lot is a script similar to User:SD0001/UnassessedArticleLinks.js, which opens pages of a certain category in a new tab and automatically opens Rater. The script I'm envisioning would automatically open the linked Wikidata item for the article in a new tab and the edit page for the article when clicking on an article in Category:Articles missing coordinates with coordinates on Wikidata.
For example, as I'm writing this the current top article alphabetically in that category is ¡Cu-Cut! incident. With this script, when clicking on the link to that article within the articles missing coordinates category listing, it would open two new tabs: one with https://en.wikipedia.org/w/index.php?title=%C2%A1Cu-Cut!_incident&action=edit open, and one with wikidata:Q14521476 open. Hopefully that makes sense? Suntooooth, it/he (talk/contribs) 23:03, 20 August 2024 (UTC)
- I think it would be possible to auto-generate and insert the coord template with the Wikidata API. Anyone interested in this can check out Special:Diff/1238811453 and wikidata:Wikidata:REST API. Aaron Liu (talk) 01:00, 21 August 2024 (UTC)
- That would be very cool - I already have my own external program for generating the coords template that copies it to clipboard, but I'd be interested in seeing an automatic on-wiki version :] Suntooooth, it/he (talk/contribs) 15:03, 21 August 2024 (UTC)