Wikipedia talk:User scripts/Archive 6

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Archive 1 Archive 4 Archive 5 Archive 6 Archive 7

Please create documentary pages for your scripts and categorize them

There are truly many highly useful scripts that make editing way more effective and time-efficient - however they are useless if people don't know about/use them. And that is the case for most of them. Creating documentary pages for scripts helps in making scripts better known to relevant people and used more in at least 3 ways:

  1. It allows the script to be findable by Google (make sure to include the "__INDEX__" magic word)
  2. The documentary page can/should at least roughly (2 sentences is sufficient already) explain what the script does which could help drive up the usage of scripts as people who e.g. got forwarded a link can learn what it's about and whether it suits their needs etc
  3. The documentary pages can be categorized

Also documentary pages are especially useful for scripts under development as many such scripts never get finished and describing what they do and making them findable despite not being featured on this page allows other programmers to build upon their work / continue it (it's also worth to note that many scripts never get finished).

Furthermore it would be nice if people here could help adding the __INDEX__ keyword, and relevant Wikipedia-categories to all script-documentary pages on here. I tried to do that in the last few days but can't do it alone (and probably won't do for new scripts). There are categories such as Category:Wikipedia citation/link tools & Category:Wikipedia counter-vandalism tools but generally any script documentary page should be added to two categories: Category:Wikipedia scripts and the maintenance category (or categories in some cases) that comes closest to their intended use - e.g. Category:Wikipedia:Watchlist.

Also I'm thinking of creating a subcategory for unfinished scripts that are under development - it could be called Category:Wikipedia scripts under development or alike.

--Fixuture (talk) 23:26, 18 January 2017 (UTC)

@Fixuture: A very good idea, never thought of the enabling indexing and categorising them per development status. That thought came across my mind at one point, what about those discontinued (inactive users), not finished or simply not added here? Couldn't think of a good way of finding and tagging all of them. Most of what you said may be added to Wikipedia:User scripts/Guide which doesn't talk about what to do after the script is made. I can help but adding docs is mostly done, ones without them as usually no brainer straightforward scripts (add subpage menu to top etc). One problematic one is User:Ravid_ziv/highlightSearch.js, what does it do? I tried installing it but couldn't figure out enough to write a doc. Ugog Nizdast (talk) 02:03, 22 January 2017 (UTC)
@Ugog Nizdast: What the script is supposed to do is, on a search page, for each result's link, add a fragment to the end of the URL with the search keyword ?keyword=. Then when you click through the link, the search term you used is supposed to be bolded on the page. The issue is that the script is broken in how it actually gets the search term (it was too brittle to a UI change) and thus nothing gets highlighted. The script can be fixed by replacing the right side of the var searchName = code with mw.config.get("searchTerm"). Opencooper (talk) 03:02, 22 January 2017 (UTC)
@Ugog Nizdast: Thank you! And also thanks for the link - that's useful.
I now thought of an additional thing that can be done here: when creating a user-space page that ends with .js / a user-script a hint for creating a documentary page could be displayed at the top of the page until the page is created. That's a Wikipedia-internal change though and I'll probably propose it at Wikipedia:Village pump later.
I know it would be kind of strange to create documentation pages for very short scripts that only do some basic stuff - but even those would be useful as others can use them module-wise and will benefit from at least the 3 points I listed above. I'm not entirely sure that there should also get documentation pages but besides the effort to create them I see no reason not to - even 5-lined scripts should be described for their functionality and may be useful to others. Also note that there's usable scripts that aren't even listed on this page.
Couldn't figure out what the script was doing by a glance either. I guess this would be the difficulty of creating missing documentation pages. Hence I hope to somehow get the writers of those scripts to document the scripts themselves (at least at first). I'm not sure what the best way for accomplishing this would be but maybe mass notices can be used to somehow be used to pm them. This talk page entry itself is an attempt at this as well. (Also @Opencooper:) this perfectly highlights the usefulness of this and potentially other reforms of the current management of user-scripts: the script could get fixed by a simply change after its intention was identified (should have been clarified instead). Now there's one problem with the current state of things: even though Opencooper user knows how the script can be fixed it can't be simply edited by him to make it work again. The current options are making an entry of the script's documentation's talk page (doesn't exist), the talk page of the editor or creating a fork of the script (how are users supposed to know the location of the working script? the only way would be to change any link to the script to point to the fork instead which is problematic for multiple reasons). Hence I suggest to improve the improvability of userscripts on Wikipedia. There are various ways this could be done. I thought about creating a {{script edit request}} template that can be placed onto the talk pages of script-documentary pages but that wouldn't really solve it as in this case there's no such page and the editor may never read it or not respond to it (or just very late). There could also be an additional user-level that's allowed to edit such pages and could review and approve such edit requests even when the script-creator is not responding though. Plus there could be a page for requests of that kind or the pending revision feature could be used to shelf such changes until it becomes approved by either script-creator or a user with said level. Thank you both for your involvement thus far.
As a sidenote in addition there could also be a Category:Wikipedia scripts with help requested for scripts whose development has been stalled by problems which are expected to be explained on the talk page if the category has been added.
--Fixuture (talk) 23:25, 22 January 2017 (UTC)
Thanks Opencooper, makes sense now. Fixuture, isn't making a separate script edit request necessary? I don't know of anything forbidding making a normal fully protected edit requests to fix a user script. Really non-controversial here given that the script is one line away from being fixed. The problem is here we don't seem to have any advice on what to do in such situations (do we?).
Another question: is making it indexable allowed? WP:NOINDEX says userspace isn't per the robot.txt or something; so isn't overriding it thus controversial? (I didn't even verify whether this would work)
Check {{Script_doc_auto}}, it gives the message "This script seems to have a documentation page at..." etc currently. Maybe a slight modification to this would be more than enough. IMO, there's not much we can do if the creators don't make docs even after this template gives them the courtesy notification. As such, I think mass messaging would be excessive given that we haven't started searching for scripts which don't have any docs yet and are inscrutable; this only concerns active editors with scripts. Overall, nothing stops us from making doc pages for those scripts we have understood if we think that's helpful.
I'm pretty sure there must be a way to search for all the possible user scripts made. I know this from Help:Searching#Parameters: restricting it to userspace, we could exclude the words in title for "vector" "mono" and "common" etc and find everything in title ending with "~.js" or "~.css". Then as we find, we could verify whether they work or/and add them to the main list. Later work on what to do with all the categories you've discussed. Ugog Nizdast (talk) 02:06, 25 January 2017 (UTC)
@Ugog Nizdast:
Fixuture, isn't making a separate script edit request necessary? I don't know of anything forbidding making a normal fully protected edit requests to fix a user script.
Alright I just looked up Category:Wikipedia fully-protected edit requests and it seems to be explicitly intended for user scripts as well so a new template & category probably aren't needed. But I think that the current way of how to scripts can be improved upon by others is pretty roundabout. They need to copy the whole content to a new userpage or so, change it and then make a very-old style / inappropriate edit request on the talk page. I think this is counterintuitive, not efficient in any way etc. The whole process should probably be rethought and streamlined in a way so that scripts can be improved upon more easily. For instance there could be a "fork" button on all script pages that does the forking to ones userpage automatically and has the fork associated/linked with the original script. Then after one changed it there could be a "merge request" or "change request" button so that the original tool can easily be requested to be changed. It could become a git-like/-oriented process.
The problem is here we don't seem to have any advice on what to do in such situations (do we?).
Indeed I don't think there is any info on how this is expected to be done. I think once we cleared things up a bit more it should be added to e.g. Wikipedia:User scripts/Guide (or any other page?) and link to it from the relevant places. But as said I think the whole process needs a redesign imo.
is making it indexable allowed? WP:NOINDEX says userspace isn't per the robot.txt or something; so isn't overriding it thus controversial?
I didn't find any such statement there. Userspace pages are just not indexed by default. Also it is useful to index Wikipedia scripts so it should be done if nobody has any objections which can be expressed here. For the indexing we should probably add it to the userscript-infobox-template instead and then simply have that one added to all script-pages.
Check , it gives the message "This script seems to have a documentation page at..." etc currently. Maybe a slight modification to this would be more than enough.
Good find, that could be useful here. However it doesn't seem to work for me for the examples linked to on that page. Also I think this template then should show above all scripts' source code pages and maybe a change to Wikipedia would be needed here. And if not it probably needs to be mass-added.
As such, I think mass messaging would be excessive given that we haven't started searching for scripts which don't have any docs yet and are inscrutable; this only concerns active editors with scripts. Overall, nothing stops us from making doc pages for those scripts we have understood if we think that's helpful.
Maybe after we cleared things up a bit more a bot could run to crawl all .js scripts and make non-intrusive talk page entries for users which have a .js script without complimentary documentary page with instructions on how such can be made. And there could be a note that shows on top when a new .js page is created with that info. I don't think that this would be problematic especially considering that those who wrote a script know best what it's for. Additionally if a script is missing from this list (WP:User_scripts) a request to add it here could be featured in the message as well.
I'm pretty sure there must be a way to search for all the possible user scripts made. I know this from Help:Searching#Parameters: restricting it to userspace, we could exclude the words in title for "vector" "mono" and "common" etc and find everything in title ending with "~.js" or "~.css". Then as we find, we could verify whether they work or/and add them to the main list. Later work on what to do with all the categories you've discussed.
It appears that neither suffix-search nor word-exclusion is featured in the search :/ (and Google search doesn't work of course as those pages aren't indexed)
So the closest I got this was this.
Also I don't think that we should just add any script here as users might have intentionally avoided making an entry about it here for whatever reason (the developer is likely to be the only one that knows why - most of the time it would probably be major bugs and the like [hence that other suggested category]).
--Fixuture (talk) 17:39, 5 February 2017 (UTC)
actually, i am not sure about suffix, but exclusion is definitely there, using the minus sign. i think the search you want is something like: intitle:/\.js$/ -intitle:"common.js" -intitle:"monobook.js" -intitle:"vector.js" it seems to be a bit cavalier about the dot (i.e., it finds pages whose name ends with js, not just .js), but other than that, i think it does what you want. feed this to the advanced search and select "User" space - you should get all the pages in user space whose name ends with .js, excluding (common|vector|monobook).js. of course, a user can have (and even use) a script that lives in a page with a name that does not end with .js, but this is a rare exception. peace - קיפודנחש (aka kipod) (talk) 20:54, 6 February 2017 (UTC)
That's good enough (for now). I tried forcing it even with ".js" but still ignores the period. Help:Searching also give an external link which uses regexp, which we could try. So, restricting to userpace, intitle:"*\?.js" -intitle:"common.js" -intitle:"monobook.js" -intitle:"vector.js". This seems more or less accurate and shouldn't be having too many wrong results. Appreciate help and will check if this can be refined even better.
Starting this search a little would be nice. I guess that the basic protocol would be check if script category exists, quickly assess its status (pasting it in the browser's console should show that), whether on this main page if required and adding the necessary categories on whether its fully functional, unknown/more investigation required, or not working/incomplete. By initiating it, we would get a stock of the situation, right now we can only reckon the amount of work. Even if we don't end up doing much, at least this plan is worked out for future and open to be continued any time. I don't think there was any previous such attempts at organisation (haven't checked). A bit swamped right now, I'll reply on what further is said above later. Ugog Nizdast (talk) 13:05, 7 February 2017 (UTC)

Script for opening watchlist items

Is there a user script that allows one to open multiple unseen watchlist items at the same time, instead of clicking on each link? Alex|The|Whovian? 11:57, 12 September 2016 (UTC)

@AlexTheWhovian: Oh wow that would be really useful. More or less it's the only missing link for managing large watchlists efficiently after I quick-fixed the hollis gadget. If it's used in combination with that tool it would basically eliminate all the automatable watchlist-work so that users can entirely focus on actually checking the contents of watchlist entries. It could add a button on the watchlist page that opens a configurable number (e.g. 10) of those "since last seen"-links successively in new tabs from the bottom up. I really hope somebody gets onto this. --Fixuture (talk) 22:30, 22 January 2017 (UTC)
@AlexTheWhovian and Fixuture:  Done, see User:Evad37/Watchlist-openUnread - Evad37 [talk] 03:38, 23 January 2017 (UTC)
Actually, the "since last visit" links are part of the enhanced watchlist, aren't they? (I don't actually use it myself) It will take a bit more work to get those links... - Evad37 [talk] 03:42, 23 January 2017 (UTC)
Fixed, now uses the "since last visit" diff links from the enhanced watchlist. - Evad37 [talk] 04:39, 23 January 2017 (UTC)
@Evad37: It seems to disappear when used with User:Theopolisme/Scripts/ajaxWatchlist, and the watchlist refreshes. Alex|The|Whovian? 14:54, 1 February 2017 (UTC)
@AlexTheWhovian: The way the ajax script works was causing all content from the Watchlist options box to the end of the list to be deleted and replaced – including the content added by my script (which only executes on page load). I've added an option to my script to add the Open unread pages button above the Watchlist options box, which make it compatible – just add
var openUnread_showAbove = true;
on the line after
importScript('User:Evad37/Watchlist-openUnread.js');
in your common.js
Forgot to sign so need to ping again: @AlexTheWhovian: - Evad37 [talk] 17:04, 1 February 2017 (UTC)
@Evad37: Great! Thank you for creating this. By this you help Wikipedia in a potentially incomparable way by significantly improving the time-efficiency of editors that will allow them to do more work here plus allow for longer watchlists which will also allow users to prevent more vandalism and misinformation.
There's just one issue with it: the "since last visit" diff links from the enhanced watchlist don't work hence the tool doesn't either. Just test it out for yourself: simply open up the history pages of articles that got edited multiple times since a few days ago (unseen) and then open up the "since last visit"-links for them (or make it so that the tool does it) → typically those diffs don't show all the changes that you can see on the history pages. So until this gets fixed for Wikipedia the tool won't work either.
I learned about this in a discussion with User:Quiddity (WMF) at 2016 Community Wishlist Survey where I suggested to "Make it easy to quickly see all changes since last visit". There I also learned about the hollis gadget from User:Stevietheman which didn't work either at the time but which I quick-fixed recently. The (quick-fixed) gadget is afaik the only way to have a diff of all unseen changes for watchlist entries.
So to make it work it either needs to be coupled with that gadget or have the (its) api-requests for getting the "since last seen"-diff-links directly built into it.
--Fixuture (talk) 23:26, 1 February 2017 (UTC)
Thanks for the comments. I'll look into using the api to generate "since last seen"-diff-links. - Evad37 [talk] 03:21, 3 February 2017 (UTC)
@Fixuture: Finally got around to coding this, better diff links are now generated using the api - Evad37 [talk] 03:30, 17 February 2017 (UTC)
@Evad37: Nice - thank you! I still have one last suggestion for improvement: as of right now one can only open a specified number of watchlist entries once. If one clicks the button a second time it doesn't open the next few items in the list but the ones opened earlier already. Probably the diffs need to be added to an array of "seen" diffs upon opening or alike. By this one could go through a whole 30-day watchlist pretty quickly by clicking the button, checking a batch of diffs, clicking the button again, checking the next batch and so on. --Fixuture (talk) 22:53, 20 February 2017 (UTC)
@Fixuture:  Done. Plus the watchlist will now show the pages as "read" once the button is clicked. - Evad37 [talk] 03:13, 21 February 2017 (UTC)
@Evad37: It works; can't thank you enough for this. It's incredibly useful...now I can finally focus on the actual work to be done :) Actually it's so useful that a potential issue I see here would be those using it having a significant advantage over those who not (as the improved time-efficiency allows for the better management of long watchlists). Especially due to that we should probably get this tool known to as many people as possible and I'll try my best with that. Maybe at some point it could even be added to Wikipedia itself (or become an option in the preferences). --Fixuture (talk) 19:38, 22 February 2017 (UTC)

User script for non-free image patrol?

Is there a user script that makes adding |image_has_rationale=yes to non-free image tags a one-click task? Even better would be marking the file patrolled as well. — Train2104 (t • c) 20:00, 1 March 2017 (UTC)

MfD closer has stopped working

Hey, MfD closer has stopped working for me in the last week or so. Does anyone know how to fix it? It looks like the owner is barely active anymore, so although I've left a message on his Talk page, I don't anticipate a reply. ♠PMC(talk) 10:15, 8 March 2017 (UTC)

I'm in the process of adding support for MfD and RfD to my XFDcloser script (which already works with AfD, CfD, FfD, & TfD). This will take some time, I can let you know when it's ready. - Evad37 [talk] 02:10, 9 March 2017 (UTC)
I would love that. Thank you! :D ♠PMC(talk) 07:07, 9 March 2017 (UTC)

Script to turn off redirects?

Any idea on whether a script that could be created that would turn off redirecting? Ideally, this would cover both pages selected through links and those accessed otherwise (search, direct URL), but even to have the first would be useful. (and any other solutions to this would be welcome)Naraht (talk) 12:01, 30 August 2017 (UTC)

The following snippet will turn off redirecting after clicking on a link:
$('#mw-content-text a.mw-redirect').each(function(){
    var oldhref = $(this).attr('href');
    var newhref = ( /\?/.test(oldhref) ) ? oldhref + '&redirect=no' : oldhref + '?redirect=no';
    $(this).attr('href', newhref);
});
- Evad37 [talk] 13:14, 30 August 2017 (UTC)
Thank you very much. I realize that turning off redirect on searches is a different concept, any ideas? (This would be so that if I type Phi Beta Kappa in the search box, it goes there rather than redirecting to Phi Beta Kappa Society, any ideas?Naraht (talk) 15:45, 30 August 2017 (UTC)
Try this:
if ( mw.config.get('wgRedirectedFrom') ) {
	(function(conf) {
		document.location.replace(conf.wgServer + conf.wgArticlePath.replace('$1', conf.wgRedirectedFrom) + '?redirect=no');
	})(mw.config.get(['wgServer', 'wgArticlePath', 'wgRedirectedFrom']));
}
The target page will still initially load, but it will then reload the redirect without redirecting – e.g. search or otherwise navigate to Phi Beta Kappa → Wikipedia will redirect you to Phi Beta Kappa Society → this code will the send you back to Phi Beta Kappa?redirect=no. Put the code at the top of your common.js so it executes as soon as possible. - Evad37 [talk] 01:14, 31 August 2017 (UTC)

One Click Archiver needs a new "owner"

User:Technical 13/Scripts/OneClickArchiver is widely used on noticeboards and other pages, but its maintainer has been blocked for a year and a half and it seems unlikely they will be returning anytime soon. I just had a bit of an issue with this script but didn't bother posting about since it appears nobody is minding the store. Anyone want to take this over? Beeblebrox (talk) 21:57, 24 February 2017 (UTC)

@Beeblebrox: I've started User:Evad37/OneClickArchiver.js, mainly because ClueBot III is down and I couldn't get any of the existing archiver scripts working. - Evad37 [talk] 05:36, 31 August 2017 (UTC)

Technical Advice IRC meeting

We'd like to invite you to the weekly Technical Advice IRC meeting. The next one is tomorrow, Wednesday 3-4 pm UTC on #wikimedia-tech.

The Technical Advice IRC meeting is open for all volunteer developers, topics and questions. This can be anything from "how to get started" over "who would be the best contact for X" to specific questions on your project.

If you know already what you would like to discuss or ask, please add your topic to the page. -- Michael Schönitzer (WMDE) (talk) 12:37, 19 September 2017 (UTC)

User:Equazcion/CustomSummaryPresets.js

Equazcion's CustomSummaryPresets user script appears to have stopped working. Does anyone know why, and how to get it working again? Any help would be much appreciated. Cheers, -- Black Falcon (talk) 20:00, 9 September 2017 (UTC)

Note that this has been done, at User:Enterprisey/CustomSummaryPresets. Enterprisey (talk!) 23:40, 5 August 2018 (UTC)

Self-redirects

Do we have a script that facilitates delinking self-redirects that are not linked to sections or anchors, or could someone write such a script? Sam Sailor 09:55, 25 February 2018 (UTC)

Sam Sailor, so this script would find links from other pages to these self-redirects, and remove those links? Enterprisey (talk!) 23:40, 5 August 2018 (UTC)
Thanks for responding, Enterprisey. Well, no, let me give an example: Face to Face (punk band). If you have User:Anomie/linkclassifier.js installed you'll notice Rob Kurth and Chad Yaro, both link back to Face to Face (punk band). The normal reader will just see the normal blue links, and if the reader clicks them, (s)he is swiftly back on the band article, perhaps without noticing the line (Redirected from Rob Kurth) underneath From Wikipedia, the free encyclopedia, and will maybe think "what is wrong here?" ... at least that is my understanding of why we avoid these WP:SELFREDS. I don't have the technical knowledge to suggest how such a script should work. Something that analyses all outgoing links, and if (a) the target is a redirect, and (b) the redirect is back to the current page, and (c) the redirect is not to a section, then delink the outgoing link. (Is this actually a job for a bot?) Sam Sailor 15:26, 6 August 2018 (UTC)
It could be a bot task, especially if it's always uncontroversial to delete self-redirects. Such a bot would have to go through quite a few articles, though (mild understatement), so it may actually be better to fix them when we see them using a script. Enterprisey (talk!) 16:21, 6 August 2018 (UTC)

Newsletter

Hi. Recently, I discovered a passion for created and understanding user scripts on wikipedia, and am planning to create a monthly newsletter about new scripts and projects (by anyone, not just promoting my own), and well as open script requests and other related information. If you would like to subscribe, please see User:DannyS712/subscribe to scripts. If you have any questions, please reach out and talk to me. --DannyS712 (talk) 00:19, 23 December 2018 (UTC)

@DannyS712: Is this aimed at script creators or general users? If its the former, I have an interview-ish Q&A exchange with The Transhumanist in my talk page archived from a little while ago that you can use. If it's the latter, you would probably be better off contributing to the WP:SIGNPOST's tech report, as they already have a substantial readership and would welcome new content. Cheers, - Evad37 [talk] 02:26, 23 December 2018 (UTC)
@Evad37: I had intended for this to be aimed at script creators. Something along the lines of: "A was created by B, C and D were updated, and the requests page lists EFGH as open requests. A new technique IJK was introduced by L as a work-around for the limitation M, etc". If there were any really powerful new scripts introduced (Twinkle, Script-installer, that kind of widely used script) it could go to the tech report, but this would be geared towards news for the script creators mostly. --DannyS712 (talk) 02:30, 23 December 2018 (UTC)
Sounds good to me! Will you be including WP-oriented JS tips and tricks? (Please say "yes").    — The Transhumanist   02:39, 23 December 2018 (UTC)
@The Transhumanist: definitely. Submissions would be welcome. --DannyS712 (talk) 02:43, 23 December 2018 (UTC)
@Evad37: I noticed you didn't join the distribution list. I don't mean to harass you, but can I ask why? Users like you were my intended audience... --DannyS712 (talk) 06:26, 24 December 2018 (UTC)
Sorry, I didn't see your response till today ('m still backlogged with notifications from my recent wikibreak, and Timeless skin which I'm using has a mildly annoying bug where new notifications aren't coloured red/blue, just grey) - Evad37 [talk] 09:44, 24 December 2018 (UTC)
@DannyS712: And see User:Evad37/Scripting Q&A for the Q&As which I mentioned, if you are interested in using them. - Evad37 [talk] 10:18, 24 December 2018 (UTC)

Draft proposal: Script modules

Could javascript-savy users please review my draft proposal for script modules – bits of Javascript code intended to be easily reused by userscripts – and leave feedback on its talk page? Cheers, Evad37 [talk] 03:01, 26 January 2019 (UTC)

Proposal: section for Frivolous/fun scripts?

It seems like the list of scripts don't contain any examples that change the interface in a funny way (they all seem like they do something! Could I add my script if it just changes the logo to something else? (say, if someone else would like to do the same thing). It could be a beginner-friendly introduction to scripting :) Tanginia (talk) 18:18, 29 January 2019 (UTC)

@Tanginia: Do you have a specific script in mind? --DannyS712 (talk) 19:03, 29 January 2019 (UTC)
Perhaps might be better as part of the WP:Department of Fun? And/or a subpage that could be linked to. - Evad37 [talk] 23:01, 29 January 2019 (UTC)

Script Feedback

Hi, I recently created User:RhinosF1/StatusChange.js to work with User:RhinosF1/Template/StatusMonitor. Any feedback would be welcome via this thread or github. If anyone wants to expand the documentation then I'm happy for you do that although I ask, if possible, you assign the related issues on GitHub to yourself and close them when done or add the 'Test Team' project if you want them reviewing. RhinosF1(chat)(status)(contribs) 15:53, 3 March 2019 (UTC)

User:Lourdes/PageCuration.js

The following discussion is an archived record of a request for comment. Please do not modify it. No further edits should be made to this discussion. A summary of the conclusions reached follows.
There is no consensus to move User:Lourdes/PageCuration.js. However, I have moved the documentation page back to User:Lourdes/PageCuration following the suggestion made by MusikAnimal and Enterprisey. feminist (talk) 11:29, 12 March 2019 (UTC)

User:Lourdes/PageCuration.js and its documentation should move to a more accurate title. I tried talking to the script's creator but they appear to not want to do it. I believe the current title is very misleading because the script adds a shortcut link to the sidebar pointing to Special:NewPagesFeed. It does not, in any way, load up the PageCuration toolbar like anyone looking at the script for the first time would expect. I propose the script to be moved to another title, for example, User:Lourdes/NewPagesFeedShortcut.js to prevent confusion. Should it be moved? -- Flooded w/them 100s 14:27, 5 February 2019 (UTC)

Survey

  • No I think you're overreacting and probably trying to find a solution to a problem that does not exist. As per Wikipedia:Page Curation/Help, Page curation...includes two main features, which are described below:
  • the New Pages Feed, a dynamic list of new pages for review by community reviewers; and
  • the Curation Toolbar...
This is exactly what the script provides to the probably greater than hundred editors or more who are using it on their scripts page, and you're the first one to complain. By the way, it adds a shortcut link to the top bar (and not the side bar), which probably shows you have misinstalled the script. The Page Curation toolbar, by its own process, is loaded up when you click on any unreviewed article in the feed. Are you doing that? And if it is not loading in your case, you can solve it by first installing this script, opening the new pages feed, and then going to the side tool bar and clicking on the menu item called "Open Page Curation". Wherever the script has been mentioned officially, its description very clearly provides the user with what it does. Wikipedia:PageCuration script is the actual documentation page for the script, moved by Oshwah to its current name. If you want, please read it. It contains the same details as are contained at the top of the script page. There is no confusion, as per me. Thanks, Lourdes 15:24, 5 February 2019 (UTC)
No, it does not provide that. It provides a link in the sidebar pointing to the feature, not the feature itself. That's a huge difference and it's misleading. -- Flooded w/them 100s 15:29, 5 February 2019 (UTC)
Are you sure we both are talking about the same script? This script does not mess with the side bar. The top message on the script page clearly mentions: "This script adds a "Page Curation" link to the top toolbar that points to Special:NewPagesFeed.". Special:NewPagesFeed is the primary page to start curating pages. In your case, if you believe this script adds a link (to the "sidebar" if you may) pointing to the feature, what is the problem you are facing? Doesn't it facilitate easy access to editors, who don't have to click on multiple links and go to multiple pages to access the feature? I'm confused what's going on here. This is a script page which is in my User space. You don't like it; don't use it. Lourdes 15:36, 5 February 2019 (UTC)
The script page's description alone is not enough. Since the WP:USL description is displayed clearly, anyone looking at it ("Page Curation[103] (source) Install – adds a "Page Curation" link to the top toolbar, primarily designed for new page reviewers") would assume the script is about force-loading the PageCuration toolbar. "Adds a Page Curation link" does not really offer disambiguation, as it leads to the question - "what page curation link?". Page curation typically refers to the curation toolbar (yes, it can mean NPF as well by project definition but common sense-wise, the toolbar is more referred to in this way). In your case...what is the problem you are facing? - the script is not titled accurately to reflect what it does, therefore it should be renamed to do so. Doesn't it facilitate easy access to editors...access the feature - it does, it's a good simple script and it works well. It's great you've made it but my concern is more about the title than its function. This is a script page which is in my User space. You don't like it; don't use it - I get the MYOB hint but really, the title is misleading and for the sake of disambiguating to help new potential users of this script or any viewer of the USL page, this is necessary. -- Flooded w/them 100s 17:14, 5 February 2019 (UTC)
How about just adding that points to Special:NewPagesFeed" to the description at WP:US/L? - Evad37 [talk] 23:51, 5 February 2019 (UTC)
Evad, that's a sensible suggestion. Can be done. Lourdes 04:03, 6 February 2019 (UTC)
Flooded, you say that "the script's page description alone is not enough." Wikipedia:Page Curation/Help mentions: "What is Page Curation?:... It consists of the New Pages Feed and the Curation toolbar..." By your arguments, we should also be renaming this page too, no? This is actually too much of an effort being wasted over a non-issue. I'm out of here (I'm okay with Evad's suggestion; not with yours). Rest, the community can decide. Warmly, Lourdes 04:07, 6 February 2019 (UTC)
It's okay, I'm done here. No need to keep this. Re-added to gain comments from more people. -- Flooded w/them 100s 09:02, 6 February 2019 (UTC) Updated: -- Flooded w/them 100s 07:59, 13 February 2019 (UTC)
  • No its their own user script, they can name it what they want. Also, if the problem is the name, I didn't know about this script when I made User:DannyS712/New pages feed, which provides a link to the new pages feed (albeit in the "interaction" menu) named "New pages". If you want to use my script, that might mitigate all of this. If not, we could just make a fork of Lourdes'? --DannyS712 (talk) 10:40, 13 February 2019 (UTC)
  • They can't if the name doesn't comply with page naming conventions. The script is named something but does something else. Also, it's not merely for my preference, but for the benefit of all Wikipedians. It may be a small matter but if it creates a problem (in this case, deception), then it should be fixed. -- Flooded w/them 100s 11:26, 13 February 2019 (UTC)
  • Comment This is a user script, and within the userpage of its author, frankly there's no way to compel them to rename it. It's akin to finding random subpages of users and asking them to be renamed because they are not clear or contain something different. If you think it's misleading, then don't use it, simple. I hope this should be closed. –Ammarpad (talk) 07:05, 14 February 2019 (UTC)
  • I'm going to have to somewhat agree with Flooded with them hundreds. As someone who has worked very hard on the Page Curation extension, I didn't appreciate that this tiny script was being advertised as integral to the process. It used to be worse, until Special:Diff/844587740 and Special:Diff/844586411. Personally I think everything is acceptable now, but if I had it my way the documentation wouldn't live in the Wikipedia namespace -- which is very rare for user scripts, at least ones that are but a few lines of code. I say all of this with utmost respect to Lourdes. Please don't take it as a personal stab :) MusikAnimal talk 04:13, 20 February 2019 (UTC)
    Haven't commented in this discussion as I don't really have an opinion, but I do agree with your final point. I'll ask Oshwah if he's okay with moving the documentation back to the usual location; it's very, very unusual for script documentation to be in project space. (As opposed to gadget documentation.) Enterprisey (talk!) 04:19, 20 February 2019 (UTC)
  • Wrong venue This should be a requested move instead. {{3x|p}}ery (talk) 20:49, 21 February 2019 (UTC)
  • Note. Oshwah has moved User:Lourdes/PageCuration to User:Lourdes/PageCurationMJLTalk 13:59, 11 March 2019 (UTC)
    Just ignore this. I can't read. It said 2018 not 2019...MJLTalk 14:01, 11 March 2019 (UTC)
LOL ~Oshwah~(talk) (contribs) 14:01, 11 March 2019 (UTC)

The above discussion is preserved as an archive of the debate. Please do not modify it. No further edits should be made to this discussion.

FR30799386's User Scripts

Dear all. Recently, FR30799386 (talk) was blocked for sock puppetry. Among their projects were a number of user scripts that they left behind. I (DannyS712) have copied the scripts, and have taken over maintaining them. You currently import one or more of FR30799386's scripts, and I thought that you might want to import a maintained version. Links to each script are provided below.

If you have any questions, please reach out and talk to me. --DannyS712 (talk) 03:57, 21 March 2019 (UTC)

Voluntary code review

Would anyone be interested in a "request for code review" process? It would be entirely voluntary, and would operate similarly to Peer review, but for sandbox/proposed versions of user scripts (or gadgets). - Evad37 [talk] 00:39, 20 February 2019 (UTC)

Sounds pretty cool. Let me know if this gets off the ground and I'd be happy to contribute. Pinging MusikAnimal as well. Enterprisey (talk!) 03:30, 20 February 2019 (UTC)
Great idea! Personally I am very busy and may not be able to contribute much (Amorymeltzer can tell you just how bad I've been about code reviews lately... :). I will definitely watchlist the page though, and of course feel free to ping me anytime. MusikAnimal talk 03:48, 20 February 2019 (UTC)
@Evad37: I may be interested; I'll mention this in the next newsletter --DannyS712 (talk) 03:44, 20 February 2019 (UTC)
The idea being to take some of the load off of VPT? Some of this happens to some degree there, although not too in-depth, and I think users needing a lot of help might get frustrated when all the traffic at VPT ignores their post. I suppose at least in theory user script questions (as opposed to Wikipedia questions) should end up here or somewhere like it rather than VPT? ~ Amory (utc) 11:27, 20 February 2019 (UTC)
Yeah, VPT isn't the best venue for actual code reviews. But this could also be for more experienced users to get someone else to look over the proposed changes and check if it looks sane. - Evad37 [talk] 11:44, 20 February 2019 (UTC)

I've made a start at Wikipedia:Code review, please feel free to add to it - Evad37 [talk] 11:44, 20 February 2019 (UTC)

@Evad37: I was going to post it there, but then I realized that wasn't what code review was designed for, so I came here. My problem is that User:DannyS712/EFFPRH.js isn't working where it is supposed to (WP:EFFPR) despite working in an identical copy at User:DannyS712/EFFPRH/sandbox. Any ideas about what could be causing this? I just can't figure it out. Thanks, --DannyS712 (talk) 03:18, 29 March 2019 (UTC)

Right venue to request review of new user script?

I just wrote a new user script, mainly to scratch my own itch but I also figure it'll be useful for others. But since this is my first user script, I'd really like to have some sanity checks and general critique before I inflict it on anyone else. What would be the most appropriate venue to make such a request? Here? VP/T? Or WP:CREV, even though the instructions there strongly imply its scope to be proposed changes to stuff in Mediawiki:-space rather than user scripts?

The script in question is: EasyLinks[1] (source)

And all feedback would, obviously, be very much appreciated! --Xover (talk) 12:37, 11 May 2019 (UTC)

@Xover: I think using CREV should be fine, given that it hasn't been used much at all --DannyS712 (talk) 22:51, 11 May 2019 (UTC)
@DannyS712: Thanks. I've created a request at Wikipedia:Code review/EasyLinks (and transcluded at WP:CREV). Any and all feedback would be appreciated. --Xover (talk) 07:07, 12 May 2019 (UTC)

  1. ^ Copy the following code, edit your user JavaScript, then paste:
    {{subst:lusc|1=User:Xover/EasyLinks.js}}

What is "WP" in this context?

What is "WP" in the following (from the lead section)?

"...to improve WP's JavaScript coverage"

Wikipedia? WikiProject?

It could be clearer.

--Mortense (talk) 19:16, 16 July 2019 (UTC)

WikiPedia - FlightTime (open channel) 19:18, 16 July 2019 (UTC)

Requesting scripts?

Are we able to request a certain script to be created? --Predated0 (talk) 19:08, 19 September 2019 (UTC)

Yes. SD0001 (talk) 18:09, 11 October 2019 (UTC)
Yes, at WP:SCRIPTREQ. Enterprisey (talk!) 08:21, 13 October 2019 (UTC)

Help: I am unable to use scripts to create redirects

Not sure if this is the right place to ask, but for some reason, when I try to use Capricorn to create redirects or AFCRHS to review WP:AFC/R requests, I encounter a "notoken" error which means that I have to create redirects manually instead. How should I fix this? feminist (talk) 02:05, 14 October 2019 (UTC)

Feminist, try it again. Wug asked me to take a look last night, and I caught it while closing down the home. Should be fine? ~ Amory (utc) 10:23, 14 October 2019 (UTC)
Amorymeltzer, thanks, Capricorn has been fixed. User:EnterpriseyBot/AFCRHS.js still needs to be updated though. feminist (talk) 12:57, 14 October 2019 (UTC)

Pinging Enterprisey. feminist (talk) 12:58, 14 October 2019 (UTC)

 Done, thanks for the heads-up. Enterprisey (talk!) 16:07, 14 October 2019 (UTC)

Need help with helper script

I am unable to get the Page Curation Helper Script. Need Help!! (HinaBB (talk) 06:48, 13 November 2019 (UTC))

Collapsed install codes

In this edit, SD0001 added a collapsed container around the install code list at the bottom of the page. That seems to be a bit problematic, though, because at least in Google Chrome 80.0.3970.5 Linux on my system, clicking on the reference number next to one of the list entries no longer scrolls the page down to the corresponding entry in the install codes list unless it's already been uncollapsed manually by the user.

Is that a local problem specific to my system, or are others seeing the same thing? If it's not just me, then perhaps the collapsed list — while a nice idea for keeping the page tidy — is not be the best approach? -- FeRDNYC (talk) 06:40, 7 December 2019 (UTC)

Hmm. That's a valid concern, but why not just copy the text from the hover tooltip, why click on the reference number at all? SD0001 (talk) 12:05, 7 December 2019 (UTC)
@SD0001: I don't completely disagree, in fact I'd even say "why not just use Script Installer?" but I have to assume that isn't an option for everyone, whether it be technical or philosophical issues that prevent them from using it. As far as the hover popups go, cutting-and-pasting text is a pretty big PITA as an install procedure to begin with, and doing it from a floating box is at least one of the outer circles of Hell. (I'm thinking especially of the code for scripts like Signing — ref. 91 under Wikipedia:User scripts/List#Discussion oriented... that code comes out to like three lines in the floating box, and trying to select it without accidentally getting the instruction text in there as well is an exercise in frustration.
It'd be great if we had click-to-copy buttons alongside each code snippet, then it would be no trouble at all for people to use the hover preview. -- FeRDNYC (talk) 00:59, 8 December 2019 (UTC)

Gadget and userscript unit testing

 – Pointer to relevant discussion elsewhere.

I've created a script to make on-wiki unit testing a bit easier to implement. Please see WP:IANB § Gadget and userscript unit testing, and comment there (not here). - Evad37 [talk] 01:09, 11 December 2019 (UTC)

User:Bellezzasolo Bot/userhighlighter.js/excon.js needs updating / bot inactive

User:Bellezzasolo seems to have retired his bot which performed regular updating of user lists for his Admin Highlighter script. Could a bot owner take over the tasks and update the lists: ptusr.js, temop.js, pgmvr.js, pcusr.js and excon.js? There may be more that I am not aware of. Thanks. Person of Few Words (talk) 17:04, 31 January 2020 (UTC)

Person of Few Words, Ah, the bot. It's a run-on-demand one that was on the desktop of my old laptop - I'll see what I can do to get it back up and running. Bellezzasolo Discuss 18:03, 31 January 2020 (UTC)

Can gadgets fetch arbitrary web page(s) text?

WordTree of "knowledge" from "What does free knowledge mean to you?" exercise submissions. Interactive version.

Can someone please help me figure out how to port my new WordTree Repl.it to a user script gadget? I haven't been able to get Wikipedia:User scripts/Guide#Using plain jQuery to load page text from an arbitrary URL. Only from project pages or just a text field in a form below the display would be fine too, I suppose. Do any snippets fetch non-WMF domain sites?

Do I need mw:OOUI/Widgets/Popups for this? I don't know jQuery, resource loader, or the Mediawiki javascript environment, so I really need help. EllenCT (talk) 06:24, 2 March 2020 (UTC)

P.S. My python version works sometimes. EllenCT (talk) 19:01, 2 March 2020 (UTC)

Snippets section isn't useful

I'd like to propose nearly removing the snippets section here. It's transcluded from Wikipedia:User scripts/Snippets, but nearly every single item there is more than a decade old and needs some level of adjusting to actually work. Most of them are probably straightforward enough — replacing addOnloadHook and using mw.config.get — are likely to be 90% of what's needed, but are these still useful? The Wikibreak enforcer gets a fair bit of play, but I would think any useful examples could be moved to Wikipedia:User scripts/Guide. I'd favor deprecating and blanking the lot of them (less wikibreak enforcement). ~ Amory (utc) 18:28, 29 July 2020 (UTC)

I'm willing to run Krinkle's tourbot on them, see how much that helps, but IMO that's just prolonging the inevitable. ~ Amory (utc) 18:56, 29 July 2020 (UTC)

Sign?

When adding scripts to the page, should users sign their post? It would sometimes help to know when a script was added to the list. — GhostInTheMachine talk to me 13:47, 30 August 2020 (UTC)

importScript() vs mw.loader.load()

Full manual instructions basically says, "use importScript() for on-wiki, mw.loader.load() for off-wiki". Looking at my common.js, I've got a random mix of the two, because I've just done whatever the script author recommended. So I've got things like:

  • mw.loader.load("/w/index.php?title=User:Writ Keeper/Scripts/logoutConfirm.js&action=raw&ctype=text/javascript");
  • mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript');

Is there any reason I can't simplify all that to:

  • importScript("User:Writ Keeper/Scripts/logoutConfirm.js");
  • importScript('User:Joeytje50/JWB.js');

or is there something more subtle going on here that led various script writers to recommend one method vs. the other? -- RoySmith (talk) 13:37, 15 August 2020 (UTC)

They both fundamentally do the same thing (include the script on page load), but importScript is deprecated so (possibly before the heat death of the universe) will, or at least might, stop working. It is therefore better to always use mw.loader.load, which is fully supported and actively developed (when necessary). The complications of minor differences in functionality are best ignored in light of these more obvious and pressing concerns. Fred Gandt · talk · contribs 22:14, 23 August 2020 (UTC)
Additionally, I would personally prefer if we had an onwiki implementation of importScript that used mw.loader.load instead of rewriting everyone's common.js pages. Enterprisey (talk!) 09:12, 18 September 2020 (UTC)

section-watchlist looking for beta testers

section-watchlist can add sections to your watchlist. It's not ready for general use yet, but it would be nice if some people tried it out and let me know what could be improved, or if any bugs occur. Enterprisey (talk!) 07:53, 20 September 2020 (UTC)

Enterprisey, are you interested in stupid people, or just the technically competent? Because I'd be happy to help but could be way more trouble than I'm worth. —valereee (talk) 16:14, 6 December 2020 (UTC)
Valereee, it wouldn't be a very useful script if only technical people used it - feel free to install it and make all the observations you want. Anything you come up with is gonna save a ton of people getting stuck on the same thing later on. Enterprisey (talk!) 07:44, 7 December 2020 (UTC)

now.monthHeader() to local language value (viwkiki)

How to convert to a local language datetime value? Thank. Alphama (talk) 18:21, 10 October 2020 (UTC)

Asked and answered at MediaWiki_talk:Gadget-Twinkle.js#now.monthHeader(). – SD0001 (talk) 09:42, 8 December 2020 (UTC)

I made a couple of scripts

I made a couple of user scripts recently.

I'm also planning to make a fork of User:SuperHamster/CiteUnseen.js (a script that puts icons next to references based on their quality). I plan to change the icons to color highlights, and add more sources from WP:NPPSG.

Anyway, just wanted to share. Feel free to leave feedback. If these are well received, I'll add them to the main list. Thanks. –Novem Linguae (talk) 06:23, 27 January 2021 (UTC)

@Novem Linguae: To tell you the truth, my version of UH is based of the script by theopolisme, Bellezzasolo, Amorymeltzer, and Pythoncoder, and they deserve just as much credit. All I did was add the tooltip to help a user memorize the colors. 😜 Chlod (say hi!) 08:24, 27 January 2021 (UTC)
trout Self-trout Apologies for my failed nopings. Chlod (say hi!) 08:27, 27 January 2021 (UTC)
Chlod, the fact that it's been forked 5 times is testament to its usefulness. And I also see from the code that there are several bots that grab and post userlists of people with perms. My hat's off to everybody involved. –Novem Linguae (talk) 08:43, 27 January 2021 (UTC)
Any reason you're not adding them to WP:User scripts/List? That's where I (and I assume quite a few people) get to introduced to new scripts. Nardog (talk) 02:40, 28 January 2021 (UTC)
Nardog. It's my first time writing user scripts. I wanted to test the waters. Thanks for the nudge, I'll go ahead and add them to the list. –Novem Linguae (talk) 02:52, 28 January 2021 (UTC)

Help debugging a script that adds a "purge" button

User:Novem Linguae/Scripts/PurgeButton.js. I want to add a link to the left menu that purges a page in one click. Twinkle already does this, but it's an extra click to open the drop down menu. I tried linking directly to &action=purge URL, but that is also an extra click (you have to hit a "Yes" button). I took sample code directly from mw:API:Purge, but it is throwing an "Uncaught ReferenceError: require is not defined". Any tips? Feel free to do a code review and/or a whole rewrite to make it more concise. My current script seems quite bloated for just adding one link. Thank you. –Novem Linguae (talk) 07:41, 23 March 2021 (UTC)

see MW:MediaWiki:Gadget-UTCLiveClock.js for the way it uses mw.loader.using. You can also add menu items via mw.util.addPortletLink, which is a lot tidier — GhostInTheMachine talk to me 10:14, 23 March 2021 (UTC)
It's not Twinkle, it's MediaWiki:Gadget-purgetab.js. You can basically rip that code and put it wherever you like by tweaking the arguments to addPortletLink(). Nardog (talk) 20:00, 23 March 2021 (UTC)

Mobile accessibility

It is impossible (for me) to copy any of these scripts. Is there any way round this. ― Qwerfjkl|   17:00, 4 April 2021 (UTC)

Incorporating usage stats into the list

I've been wondering if we could incorporate the stats in /Most imported scripts into /List directly, so people could find popular scripts more easily. Like:

Name Description Total users Active users
12HourFormat (source) Changes occurrences of 24-hour times to 12-hour (AM/PM) times. Works in logs, page histories, file history tables, etc.
How to install
Click here and paste:
{{subst:lusc|1=User:Guywan/Scripts/12HourFormat.js}}
33 7
Article Quality (AQ) Fetcher (source) Stylizes article links according to the grade of the target article as based on the assessment team's quality scale.
How to install
Click here and paste:
{{subst:lusc|1=User:N8wilson/AQFetcher.js}}
70 16

@SD0001: Can your bot dump the data in a Lua table? Nardog (talk) 02:49, 7 April 2021 (UTC)

@Nardog: Don't really know what a lua table is. JSON would be simpler from bot-code perspective. Either way, if you can file a pull request for https://github.com/siddharthvp/SDZeroBot/blob/master/reports/most-imported-scripts/most-imported-scripts.js I would happily take a look. – SD0001 (talk) 07:21, 7 April 2021 (UTC)
A Lua table would look like:
return {
	["User:Lupin/popups.js"] = {
		total = 8766,
		active = 353
	},
	["User:AzaToth/twinkle.js"] = {
		total = 5484,
		active = 365
	},
}
But as you can see, I've gone ahead with a module that directly fetches /Most imported scripts and returns it in a Lua table. Either way, formatting data in a Lua table allows using mw.loadData(), which means the code that returns the data can be executed just once per page rendition rather than for each template transclusion. Nardog (talk) 05:33, 10 April 2021 (UTC)

Any XSS danger from getJSON()?

I have some code.

		$.getJSON(mw.config.get('wgScriptPath')+'/index.php?action=raw&ctype=application/json&title=User:Novem_Linguae/User_lists/10k-edits.js', function(data){
			tenkdata = data;
		}),

Would there be any XSS danger from having this load a regular page in my userspace, instead of a highly protected .js page? The ability to enlist the help of others to keep lists like this updated is appealing. For example, a list of unreliable sources. –Novem Linguae (talk) 14:26, 4 February 2021 (UTC)

Important: As of jQuery 1.4, if the JSON file contains a syntax error, the request will usually fail silently. Avoid frequent hand-editing of JSON data for this reason. JSON is a data-interchange format with syntax rules that are stricter than those of JavaScript's object literal notation. For example, all strings represented in JSON, whether they are properties or values, must be enclosed in double-quotes. For details on the JSON format, see https://json.org/.

In fact, just playing around a bit in my browser console window, when I do

$.getJSON('https://en.wikipedia.org/wiki/User:Novem_Linguae/User_lists/10k-edits.js')

I get .statusText set to "parsererror". Looking at User:Novem Linguae/User lists/10k-edits.js, I'm guessing that's the:

"ساجد امجد ساجد": 1,

line, and further guessing you've got some script which generated this and went off the rails with RTL text. So maybe this isn't what you want to do. -- RoySmith (talk) 19:59, 4 February 2021 (UTC)

RoySmith, thanks for the detailed reply. I think you'll find that if you type this in your console, you'll get statusText success instead.
$.getJSON('/w/index.php?action=raw&ctype=application/json&title=User:Novem_Linguae/User_lists/10k-edits.js')
According to Stack Overflow, the parseerror was from the file MIME type not being JSON. The URL above (and what is used in the user script) solves that issue.
Good to know about the function failing silently. I can code a check to make sure the retrieved data is valid. –Novem Linguae (talk) 07:31, 5 February 2021 (UTC)
Novem Linguae, I (or another admin) can also change the content model of the page to JSON so that saving incorrect JSON will give an error instead, if you want. Enterprisey (talk!) 08:30, 5 February 2021 (UTC)
You don't have to be an admin to be able to change the content model of a page in your own userspace. Also you can make a JSON page by creating it under a name that ends in .json, obviously. Nardog (talk) 08:57, 5 February 2021 (UTC)
Nardog, I think an admin might be needed. When trying to create a .json page in my userspace, create page does pop up, but any attempt to submit just reloads the page with the editor, akin to hitting preview. I do see some non admins changing to JSON content model in the log though, so maybe I'm missing something. –Novem Linguae (talk) 09:08, 5 February 2021 (UTC)
Try Special:ChangeContentModel/User:Novem Linguae/User lists/10k-edits.js. That's weird, since I've just done it [1]. Nardog (talk) 09:17, 5 February 2021 (UTC)
You do not have permission to edit the content model of a page, for the following reason: The action you have requested is limited to users in one of the groups: Administrators, Template editors. Ah. There's our answer. Template editors can do it. –Novem Linguae (talk) 09:22, 5 February 2021 (UTC)
  • Good to know about the mime type thing, but I'm still confused about the:
"ساجد امجد ساجد": 1,

line. That's clearly not valid json. Is it just being rendered wrong on the screen because of the mixed RTL and LTR text? -- RoySmith (talk) 14:18, 5 February 2021 (UTC)

Hmmm, I've dug into this some more. That line really does contain:
Cc '\t'
Po QUOTATION MARK
Lo ARABIC LETTER SEEN
Lo ARABIC LETTER ALEF
Lo ARABIC LETTER JEEM
Lo ARABIC LETTER DAL
Zs SPACE
Lo ARABIC LETTER ALEF
Lo ARABIC LETTER MEEM
Lo ARABIC LETTER JEEM
Lo ARABIC LETTER DAL 
Zs SPACE
Lo ARABIC LETTER SEEN
Lo ARABIC LETTER ALEF
Lo ARABIC LETTER JEEM
Lo ARABIC LETTER DAL 
Po QUOTATION MARK
Po COLON
Zs SPACE
Nd DIGIT ONE
Po COMMA
Cc '\n'
so, clearly what I'm seeing is just an artifact of how bidirectional text is rendered. Unicode always makes my brain hurt. Back when I was a kid, we were happy carving our ASCII characters into our stone tablets with pointed sticks. -- RoySmith (talk) 16:30, 5 February 2021 (UTC)
@RoySmith: That whole situation is on my list of "Why we can't have nice things". Unicode finally brought first-class support for rendering text in multiple scripts and in multiple native directions, yay! ...Aaand, now there's a whole new class of malware out there which uses text-direction trickery in its filenames. When skillfully employed, Unicode's direction control characters can rearrange the parts of a filename to make a malicious .exe file appear to have some other, safer extension. (The true .exe extension ends up somewhere in the middle of the name, when rendered LTR, while some other part of the string becomes the rightmost text and masquerades as the extension. The attacker bets that users will more cavalierly and recklessly click on an unknown file if appears to have, say, a .txt extension. Evidence suggests that's a smart bet.) -- FeRDNYC (talk) 16:34, 12 April 2021 (UTC)
FeRDNYC, Yeah, the cleverness of spammers, scammers, and grifters never ceases to amaze me, but that's not a new phenomenon. -- RoySmith (talk) 16:54, 12 April 2021 (UTC)

Script not appearing

User:Qwerfjkl/JS cleaner.js doesn't seem to appear in the TemplateScript toolbar; any idea why? ―Qwerfjkltalk 17:27, 12 July 2021 (UTC)

Table changes

Please split column 1 to two columns – name and source. That way the word source need not be in brackets and they all align.
Also move the numbers columns (3 and 4 at the mometnt) to after the Source column. That way the large column is at the end of the row — GhostInTheMachine talk to me 13:49, 17 May 2021 (UTC)

That way the large column is at the end of the row And why would we want that? As a reader I really prefer the names and descriptions to be close together, as they are about the only essential pieces of information when you're looking for scripts after all. Splitting the first column and placing the sources after the descriptions does bring the names and descriptions closer, but I just tested it and turns out there's often enough space for a link after the name of a script anyway because of the differences in the lengths of names (and for scripts that lack documentation, the scripts themselves serve as documentation, making it make more sense to have the names and source links closer). I don't see a benefit. Nardog (talk) 00:59, 18 May 2021 (UTC)

Columns for conflicts, alternates and last change dates

How about we include columns here for:

  1. conflicts between scripts, with site preferences and with particular skins (e.g. Wikipedia:Village pump (technical)#Reply link);
  2. alternate scripts or site preferences that perform similar functionality (e.g. User:MusikAnimal/nightpedia x User:SD0001/dark-mode-toggle.js x mw:Skin:Vector/DarkCSS, User:Esquivalience/mathjax x Special:GlobalPreferences#mw-prefsection-rendering-math); and
  3. the last edit date done on the script?

A column for the script author would be nice too, but perhaps that'd make the tables too cramped. — 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚 (talk) 01:17, 12 May 2021 (UTC)

I considered adding last modified dates, as I too would find them useful, but automating it was infeasible as it would exceed the template limits. So it would have to be updated more or less manually, or by a bot. As for the other columns you suggest, I don't see the necessity when such pieces of information can be just included in the description. Nardog (talk) 04:42, 12 May 2021 (UTC)
automating it was infeasible
What about {{REVISIONTIMESTAMP}}? E.g.: {{REVISIONTIMESTAMP:User:MusikAnimal/nightpedia}}: 13 February 2022
such pieces of information can be just included in the description.
Sure, they all can. In fact, all columns could be lumped into one big description for each script. But then... we use tables bc they're easier to read, no? Besides, there's barely any info about conflicts and alternates in those tables; having them as columns prompts editors to fill them out. — 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚 (talk) 05:17, 12 May 2021 (UTC)
Well, REVISIONTIMESTAMP is exactly what I tested and what made it exceed the limits (is there any other way?). We'd need to either subst the values, split the list into several pages, or write a bot.
How many scripts out of 583 on the list do you think such columns would be applicable to? Who will test all the combinations? Even if someone did it would quickly become out of date. Similar scripts already appear in the same sections, and if a script stops working or gets superseded by a MW feature we should simply remove it from the list. Dedicated columns would be impracticable and overkill. Nardog (talk) 06:55, 12 May 2021 (UTC)
We'd need to either subst the values, split the list into several pages, or write a bot.
Yeah, that does sound like a lot of work. I'm surprised a parse function breaks template limits. Will have to do without, then.
How many scripts out of 583 on the list do you think such columns would be applicable to?
Most. There already are many forks of the same scripts, and scripts whose functions have been incorporated into site preferences.
Who will test all the combinations?
Us, users. I'm always trying things out. And often find things that duplicate function or straight up don't work. There's currently nowhere central to notify other users. I'd also appreciate their heads up too (especially from the author).
Even if someone did it would quickly become out of date.
Such is the beauty of a wiki; it's a living document. We can always update as we go along.
if a script stops working or gets superseded by a MW feature we should simply remove it from the list.
That could be a next step. Having the info stated clearly on a separate column, makes it easier to single out which ones to clear. OTOH, MW features may not fully replicate the functionality of user scripts, and some users may prefer the script over the MW feature, e.g. User:Enterprisey/reply-link x mw:commons:User:Jack who built the house/Convenient_Discussions x mw:Talk pages project/Replying:
I have two reply links for comment (reply) - from the user script - and [ reply ] - from the Beta tool - but recently, they have only appeared momentarily, and the dissapear, and I am sent near to the bottom of the page. ― Qwerfjkl  (please use {{reply to|Qwerfjkl}} on reply) 19:30, 10 May 2021 (UTC)
The User:Enterprisey/reply-link.js user script is probably interfering with the new reply feature in mediawiki. Enterprisey script shows the "(reply)" and mediawiki shows "[reply]".--Snævar (talk) 19:55, 10 May 2021 (UTC)
Shucks, I should probably fix that. Enterprisey (talk!) 05:17, 11 May 2021 (UTC)
Is there any benefit in keeping them both? — 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚 (talk) 06:24, 11 May 2021 (UTC)
There's also Convenient Discussions which I personally find so much better than either of these two. It uses the very same comment parsing code as the [reply] beta tool. – SD0001 (talk) 07:07, 11 May 2021 (UTC)
— 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚 (talk) 07:22, 12 May 2021 (UTC)
Here you go; had a got at it: https://en.wikipedia.org/wiki/Wikipedia:User_scripts/List/sandbox#Body
What do you reckon? — 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚 (talk) 23:33, 14 May 2021 (UTC)
Like I feared, the conflicts and alternates columns are rarely filled and gratuitously expand the tables, making the descriptions harder to read. Why anyone would think it's a good idea is beyond me, and I strongly suggest you get a consensus of a wider group of editors before moving forward with it.
I don't oppose to the author column as strongly as to the others, but I decided against it when I revamped the page because ultimately it's not as vital or relevant to all users. And if we were to add it at all, I would place it after the description, link to the talk as well because that's the place to go to for inquiries about a script, and name it "Host" instead of "Author" because the user the script page belongs to does not always coincide with who wrote it. Nardog (talk) 03:00, 15 May 2021 (UTC)
Like I feared, the conflicts and alternates columns are rarely filled
I just filled it for a few rows as examples; hardly an indication of what it would look like in the end, of course. — 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚 (talk) 05:38, 15 May 2021 (UTC)
And it's worse for it. Leaving them empty makes the columns pointless. Filling them in makes the whole tables harder to read. Either way they make finding scripts more difficult, if you ask me. Nardog (talk) 07:52, 17 May 2021 (UTC)
I considered adding last modified dates, as I too would find them useful, but automating it was infeasible as it would exceed the template limits.
 Dunnit. — 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚 (talk) 17:24, 28 May 2021 (UTC)
No to adding conflicts or alternates columns — they should be included in the description or kept in the talk page for the script itself. I would be much more interested in the creation date, the count of edits since then and the last modified date — GhostInTheMachine talk to me 13:40, 17 May 2021 (UTC)

Watchlist

Is there a script or something else that will allow me to get alerts or notifications to pages on my watchlist? Heesxiisolehh (talk) 20:57, 6 June 2021 (UTC)

Have you had a look at the Watchlist section of WP:USL? — 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚  22:57, 6 June 2021 (UTC)
@Guarapiranga:, it seems none of the scripts has a description for "shows changes to pages on your watchlist". It seems User:Danski454/unwatch, user:js/watchlist or User:Evad37/Watchlist-openUnread might fit the bill, but I'm unsure. Heesxiisolehh (talk) 23:36, 6 June 2021 (UTC)
Rather, see the first section ("Site-wide"). Nardog (talk) 00:24, 7 June 2021 (UTC)
Right! Personally, I use Watchlist-watcher and Watchlist scout. — 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚  00:56, 7 June 2021 (UTC)

Not working

Some user scripts are not working for me. Is there a limit to the number of scripts I can use at the same time? —hueman1 (talk contributions) 14:01, 11 June 2021 (UTC)

@HueMan1: We can't help unless you tell us which ones aren't working. --Redrose64 🌹 (talk) 07:41, 13 June 2021 (UTC)
@Redrose64: One example is RedWarn. —hueman1 (talk contributions) 07:51, 13 June 2021 (UTC)
I'm a confessed script junkie, HueMan1, and have quite a lot of them installed. I find the scripts you run are limited rather by conflicts between them than by their sheer number. — 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚  08:25, 13 June 2021 (UTC)
@Guarapiranga: What should I do? —hueman1 (talk contributions) 08:40, 13 June 2021 (UTC)

I don't mind your latest change to the WP:User scripts/Ranking, GKFX, but I'm curious: what was the issue there? The invoke params you replaced the template with were already the ones used in {{User scripts table/main}} (I agree the template wrapping is largely unnecessary now; I built them before I figured out I needed to ditch Module:Transcluder to get the page to run under the 10s limit, and so needed to cache it in tranches with {{template cache}}). — 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚  08:34, 13 June 2021 (UTC)

The navboxes at the bottom weren't displaying. The page now is about 700 kB PEIS, it would have been about three times that with two layers of nesting, and 3 × 700 kB > 2 MB so it was over the limit. User:GKFXtalk 08:37, 13 June 2021 (UTC)
Thumbs up icon Cheers. — 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚  08:41, 13 June 2021 (UTC)

Turn on console errors in JavaScript

Hello. Any tips for getting user scripts to report as many front end JavaScript errors as possible? I've noticed that JQuery tends to fail silently sometimes. For example, I was using $.getJSON on something, and the third party JSON data had single quotes instead of double quotes, which caused a silent failure with no console warnings/errors. Is there any way to turn on verbose warnings/errors for JQuery and for user scripts in general? Thanks. –Novem Linguae (talk) 06:54, 30 April 2021 (UTC)

@Novem Linguae I think there's an option in preferences for showing JavaScript errors. ― Qwerfjkl | 𝕋𝔸𝕃𝕂  (please use {{reply to|Qwerfjkl}} on reply) 13:30, 13 June 2021 (UTC)

Uncaught TypeError

User:Novem Linguae/Scripts/UserHighlighterSimple.js

Uncaught TypeError: Cannot read property 'apply' of undefined
   at Object.add (<anonymous>:612:407)
   at index.php?title=User:Novem_Linguae/Scripts/UserHighlighterSimple.js&action=raw&ctype=text/javascript:7

This bug has absolutely no effect on my user script's functionality. But it throws that warning in the browser console on every page load. Any idea how to fix it? I forked some of this code so I am not too familiar with mw.hook, $.when, etc. Thanks. –Novem Linguae (talk) 05:55, 8 July 2021 (UTC)

@Novem Linguae: mw.hook('wikipage.content').add(...) is doing nothing. Since you're executing the function (function($, mw){...}) instead of passing it as a handler, the function is executed only once as soon as the script is loaded. I would change line 7 to mw.hook('wikipage.content').add(function($content){, 83 to $content.find('a').each(function(index,linkraw){, and 177 to });, and move line 7 to after line 37 (so that the JSON fetches would be done only once, not every time wikipage.content is fired). Nardog (talk) 21:21, 16 July 2021 (UTC)
Nardog, the line 7 and 177 changes fixed the error. Awesome. The line 83 change made the script stop highlighting. I'll dig into the line 83 suggestion, and the swap 7 and 37 suggestion soon. Thank you very much for your help. –Novem Linguae (talk) 23:04, 16 July 2021 (UTC)
Weird, this revision totally works for me. Also, get mw.util.addCSS() out of the handler, or the style tags will be added every time wikipage.content is fired. If you use mw.loader.addStyleTag() you don't even have to declare a dependency (also, why add a tag for each rule instead of just one tag for all?). And I don't think it's appropriate to put the client-error opt-out (or any experimental code for that matter) in a script that's been imported by others. Nardog (talk) 00:07, 17 July 2021 (UTC)

Not digging the new layout

I haven't looked at this list in months and just noticed the new layout moving from bullet-list to tables. I know that took a lot of work and it's been up for a few months now, so ignore me if it's just me, but put me down as one editor who vastly prefers the bullet-list format to the table format. For me, this went from an easy-to-navigate list to a difficult-to-navigate table. For my own easy-of-use, I put a copy of the old list-style version from April at User:Levivich/Old USL, in case anyone else wants it. Levivich 14:57, 16 July 2021 (UTC)

Hmm, sorry to hear that. The revamp involved not just the switch to tables but a lot of refining the classification and adding/removing scripts. This CSS more or less brings back the old layout if you like:
.userscripttable {
	background: none;
	border: 0;
	margin: 0.3em 0 0 1.6em;
}

.userscripttable tr {
	display: list-item;
}

.userscripttable > tbody td {
	display: inline;
	border: 0;
	padding: 0;
	padding-left: inherit;
}

.userscripttable td:first-child::after {
	content: '\00a0– ';
}

.userscripttable > thead,
.userscripttable-instruction,
.userscripttable td:nth-child(3), .userscripttable td:nth-child(4) {
	display: none;
}
Nardog (talk) 16:01, 16 July 2021 (UTC)
@Nardog: Thank you for writing code for luddites like me, it works! :-) Levivich 14:15, 17 July 2021 (UTC)

Check if a page is "marked as reviewed"

In a user script, what's the easiest way to check if a page has been "marked as reviewed" by a new page patroller? I assume an API call of some kind? I was looking into prop=flagged, but that wasn't returning useful info. In SQL, it can be checked with a query to the pagetriage_page table's ptrp_reviewed column. Thanks. –Novem Linguae (talk) 09:59, 3 August 2021 (UTC)

action=query&list=logevents&letype=patrol. Nardog (talk) 01:40, 7 August 2021 (UTC)

Reusing this data in Toolhub

I have built a tool that parses the wikitext of Wikipedia:User scripts and generates a toolinfo.json document which can be used by Toolhub, Hay's Directory, and other toolinfo consumers. As a result, there are now almost 600 user scripts newly documented by the Toolhub demo server.

Thank you to Nardog for Template:User script table row and to everyone else who has used it to document their scripts at Wikipedia:User scripts/List. --BDavis (WMF) (talk) 15:47, 23 August 2021 (UTC)

Edit summary

Hi, my script (a simple fork of Writ Keeper's) doesn't seem to add an edit summary when editing pages, though it does when creating them (see here). ― Qwerfjkltalk 19:43, 1 September 2021 (UTC)

@Qwerfjkl Hi. First of all, you may use beautifier.io (or other code beautifiers found by a google search) to beautify your code and make it more readable.
I'm not an expert, but as i can see on mw:API:Edit, when you set section parameter together with summary parameter (as you did in requestData2 variable), the value passed to summary will be used as the section title (as seen in the diff you provided). you can use appendtext instead and provide some text strings as its value. something like appendtext" sectionTitle + [a variable containing the Talkback template and its parameter values] is a good value for this parameter. So you have to replace section: 'new' with appendtext: talkBackMessage where talkBackMessage is what is going to be appended to the bottom of the user's talk page. As i am not a Javascript expert (just a fan, coding for fun), test it and let me know if it works. Jeeputer (talk) 11:00, 24 September 2021 (UTC)
I think that worked. ― Qwerfjkltalk 12:14, 26 September 2021 (UTC)
@Qwerfjkl: Glad to hear that. :) Jeeputer (talk) 12:42, 26 September 2021 (UTC)

Documentation update

Hi. Looks like Wikipedia:User_scripts#How_do_you_add_new_scripts_to_the_scripts_list? needs to be updated based on the new list layout. Jeeputer (talk) 11:07, 24 September 2021 (UTC)

Done. Thanks for noting this. Nardog (talk) 23:38, 26 September 2021 (UTC)

Unwatch scripts

Novem Linguae, the scripts you added a note to in Special:Diff/1059200083 are both based on mw:Snippets/Unwatch from watchlist which was made in 2011 or earlier. Unwatch as a default feature was added in 2018: phab:T2424. Not sure why Insertcleverphrasehere and Danski454 forked the snippet in 2019, maybe they didn't know about the default feature yet or their scripts do something different. — Alexis Jazz (talk or ping me) 22:20, 8 December 2021 (UTC)

Should we remove the "total" or "active" column?

I don't think we need two columns saying how many people have this installed. Maybe we only need the "active" one? Enterprisey (talk!) 00:27, 30 September 2021 (UTC)

I agree that having two is unnecessary. ― Qwerfjkltalk 10:53, 11 December 2021 (UTC)