Wikipedia talk:WikiProject JavaScript: Difference between revisions

Content deleted Content added
Notifying WikiProject of move discussion on Talk:GNOME
 
(47 intermediate revisions by 19 users not shown)
Line 1:
{{Talk header |shortcut=WT:JS }}
{{WikiProject banner shell|
{{WikiProject JavaScript}}
}}
{{archive box}}
 
Line 6 ⟶ 8:
 
Feel free to share the details of your user script projects, your problems, your ideas, and your JavaScript-related technological fantasies on this page. :) [[User talk:The Transhumanist|<i>The&nbsp;Transhumanist</i>]] 01:10, 14 April 2017 (UTC)
 
==Discussion at [[Wikipedia:Village pump (technical)#Creating and saving a preloaded page with one click]]==
[[File:Farm-Fresh eye.png|15px|link=|alt=]]&nbsp;You are invited to join the discussion at [[Wikipedia:Village pump (technical)#Creating and saving a preloaded page with one click]]. <span style="color:#AAA"><small>&#123;{u&#124;</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}&#125;</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 19:42, 14 June 2020 (UTC){{Z48}}<!-- [[Template:Please see]] -->
 
== Looking for a userscript demonstrating a function ==
Line 21 ⟶ 20:
::It's certainly fine to have this script parse wikitext only while editing if that makes things easier. But since the script is only useful interacting with a few specific templates, it's completely reasonable to just program the templates with custom HTML classes for the script data. I would assume that would vastly simplify extracting those values. [[User:Vanisaac|Van]][[User talk:Vanisaac|Isaac]]<sub><small>[[WP:WikiProject Writing systems|WS]]</small></sub><sup style="margin-left:-3.0ex">[[Special:Contributions/Vanisaac|cont]]</sup> 18:04, 25 June 2020 (UTC)
 
A little late, but is it supposed to scroll down to where the template is and open up a screen, then load the parameters? <div style="background-color: #fef1d5;width:200px;font-size:1.25em;">[[User:SikiWtideI|'''SikiWtideI's user page''']]<div style="clear:both;"></div> [[User talk:SikiWtideI|<sup>'''Talk'''<sub>to the backwards police</sub></sup>]] </div> 00:37, 15 January 2023 (UTC)
== Proposal ==
 
== Calling for volunteers for [[WP:RedWarn|RedWarn]] - a fast growing new JavaScript counter-vandalism tool ==
{{Wikipedia:RedWarn/Volunteer}}
::Made this horrible infographic too: [[File:RWToolforgeAuthDiagram.png|center|frameless]]- [[User:Ed6767|<span style="font-family:'Roboto',sans-serif;font-weight:300;text-shadow: 2px 2px 10px black;color:black;">Ed<span style="color:red;">6767</span></span>]] [[User talk:Ed6767|<span style="color:black;"><strong>talk!</strong></span>]] 1815:2009, 315 July 2020 (UTC)
 
== OneClickUnarchiver ==
 
It's not uncommon to need to restore a discussion from a talk venue archive, but it's not easy to do it correctly and exceeds the ability of many editors. I wonder if anyone would be interested in creating a restore-from-archive script modeled after [[Wikipedia:One click archiving|OneClickArchiver]]. Instead of clicking an "Archive" link on a talk page, one would click a "Restore" link on an archive page. The coding would be a little simpler than OneClickArchiver, which has to worry about whether it's time to create a new archive page. Any taker? ―[[User:Mandruss|<span style="color:#775C57;">'''''Mandruss'''''</span>]]&nbsp;[[User talk:Mandruss|<span style="color:#888;">&#9742;</span>]] 22:08, 27 November 2020 (UTC)
 
== Proposal to change the user scripts header message ==
 
The [[Mediawiki:Clearyourcache]] message should link "scripts" to [[WP:US]]. I made a proposal at [[Template talk:Script doc auto#Proposal: link to WP:US]]. [[User:Enterprisey|Enterprisey]]&nbsp;([[User talk:Enterprisey|talk!]]) 21:50, 13 December 2020 (UTC)
:So I did this, and then out of curiosity looked at the pageviews stats for WP:US. Looks like they went from 60-80ish daily earlier this year, and then plunged at the beginning of May to 20-40ish daily, where they remain. Did it get de-linked from somewhere big? (pinging people from the discussion at TT:Script doc auto, who definitely didn't ask to get pinged but I figure might still be interested: {{ping|Sj|SD0001|DannyS712|prefix=|p=}}) [[User:Enterprisey|Enterprisey]]&nbsp;([[User talk:Enterprisey|talk!]]) 09:25, 19 December 2020 (UTC)
:: Interesting. Can't think of a reason... <span style="color:#666">&ndash;&nbsp;[[User:Sj|SJ]][[User Talk:Sj|<span style="color:#f90;">&nbsp;+</span>]]</span> 03:12, 24 December 2020 (UTC)
 
== Moving snippets to user space ==
 
Hi there! I am going to suggest moving [[Wikipedia:User scripts#Snippets|these user script "snippets"]] formerly managed by WikiProject User scripts to be migrated to user space. This brings multiple advantages, but mainly improves security (they would be interface-admin protected essentially), and readability / ease-of-use (the pages that are not currently marked as JS in terms of content model would be able to be installed using scripts like scriptinstaller). [[User:EpicPupper|🐶 EpicPupper]] <sup>(he/him &#124; [[User talk:EpicPupper|talk]])</sup> 19:13, 13 March 2022 (UTC)
 
==Help: IllWill.js==
There is a problem with the behaviour of [[User:Cobaltcigs]]'s [[User:Cobaltcigs/IllWill.js|IllWill.js]]: If I fill in the edit summary as I go along editing an article, and then invoke that script, it overwrites my edit summary with its own. I'm no expert in JavaScript, but it occurs to me that changing in line 162 the operator <code>=</code> to <code>+=</code> would fix that. Then again, it might need more elaborate coding. I [[Special:diff/1235258054|left a message]] on the user's talk page, but he hasn't edited for some months, so I would appreciate it if someone here could fix this. -- [[User:Michael Bednarek|Michael Bednarek]] ([[User talk:Michael Bednarek|talk]]) 07:11, 31 July 2024 (UTC)
 
== [[:React (JavaScript library)]] listed at Requested moves==
Hello all. I have made a proposal over at the village pump which you may be interested in regarding user scripts. See [[Wikipedia:Village_pump_(proposals)#Proposal_regarding_a_user_script_approval_process]] [[User:Ed6767|<span style="font-family:'Roboto',sans-serif;font-weight:300;color:red;text-shadow: 2px 2px 10px black;">Ed6767</span>]] [[User talk:Ed6767|<span style="color:black;"><strong>talk!</strong></span>]] 02:29, 26 June 2020 (UTC)
[[File:Information.svg|30px|left]]A [[Wikipedia:Requested moves|requested move]] discussion has been initiated for [[:React (JavaScript library)]] to be moved to [[React (software)]]. This page is of interest to this WikiProject and interested members may want to participate in the discussion [[Talk:React (JavaScript library)#Requested move 8 November 2024|here]].<!-- Talk:React (JavaScript library)#Requested move 8 November 2024 crosspost --> —[[User:RMCD bot|RMCD bot]] 03:50, 8 November 2024 (UTC)
:<small>To opt out of RM notifications on this page, transclude {{tlp|bots|2=deny=RMCD bot}}, or set up [[Wikipedia:Article alerts|Article alerts]] for this WikiProject.</small>
 
== [[:A-Frame (virtual reality framework)]] listed at Requested moves==
== Help with auth to Toolforge? ==
[[File:Information.svg|30px|left]]A [[Wikipedia:Requested moves|requested move]] discussion has been initiated for [[:A-Frame (virtual reality framework)]] to be moved to [[A-Frame (extended reality framework)]]. This page is of interest to this WikiProject and interested members may want to participate in the discussion [[Talk:A-Frame (virtual reality framework)#Requested move 18 April 2025|here]].<!-- Talk:A-Frame (virtual reality framework)#Requested move 18 April 2025 crosspost --> —[[User:RMCD bot|RMCD bot]] 08:12, 18 April 2025 (UTC)
:<small>To opt out of RM notifications on this page, transclude {{tlp|bots|2=deny=RMCD bot}}, or set up [[Wikipedia:Article alerts|Article alerts]] for this WikiProject.</small>
 
== [[:GNOME]] listed at Requested moves==
Anyone know how I can authenticate a request from a user script to a Toolforge tool? I'm not sure OAuth would work, since I figure that uses cookies (but I would be happy to be wrong about that). I could always have the user script make an edit or a log entry and pass the diff/log entry ID with the request, but that seems spammy. [[User:Enterprisey|Enterprisey]]&nbsp;([[User talk:Enterprisey|talk!]]) 07:12, 3 July 2020 (UTC)
[[File:Information.svg|30px|left]]A [[Wikipedia:Requested moves|requested move]] discussion has been initiated for [[:GNOME]] to be moved to [[GNOME (desktop environment)]]. This page is of interest to this WikiProject and interested members may want to participate in the discussion [[Talk:GNOME#Requested move 7 July 2025|here]].<!-- Talk:GNOME#Requested move 7 July 2025 crosspost --> —[[User:RMCD bot|RMCD bot]] 12:01, 7 July 2025 (UTC)
:OAuth doesn't use cookies... see [[mw:OAuth/For Developers#OAuth_in_a_nutshell]] - <u>'''[[User:Evad37|Evad]]''37'''''</u>&nbsp;<span style="font-size:95%;">&#91;[[d:w:User talk:Evad37|talk]]]</span> 08:13, 3 July 2020 (UTC)
:<small>To opt out of RM notifications on this page, transclude {{tlp|bots|2=deny=RMCD bot}}, or set up [[Wikipedia:Article alerts|Article alerts]] for this WikiProject.</small>
::{{u|Evad37}}, so I was thinking that I would send a request from the user script to the tool, and the tool would then query rest.php/oauth2/resource/profile to see if the user is logged in. That's not the correct use of OAuth, I think (because I would be sending a token associated with the user to /profile, so the answer (barring token expiration) would always be "yes, the user's logged in"). I'm not sure how else to validate that a user is logged in without somehow making a request from the tool that carries the en.wp session cookies. [[User:Enterprisey|Enterprisey]]&nbsp;([[User talk:Enterprisey|talk!]]) 08:30, 3 July 2020 (UTC)
:::{{re|Enterprisey}} Hmmm... What's this for anyway? Maybe there's a different approach you could use. - <u>'''[[User:Evad37|Evad]]''37'''''</u>&nbsp;<span style="font-size:95%;">&#91;[[d:w:User talk:Evad37|talk]]]</span> 09:26, 3 July 2020 (UTC)
::::A tool for watchlisting a section (a user can subscribe/unsubscribe to a section). I don't want to store subscription lists onwiki because sections can move, be merged, etc, which would require a bot to update them. Also, just as watchlists aren't public, section watchlists shouldn't be, either. Thus, I want the userscript to make authenticated requests to a tool that stores the subscription lists in a database. [[User:Enterprisey|Enterprisey]]&nbsp;([[User talk:Enterprisey|talk!]]) 00:15, 4 July 2020 (UTC)
:{{u|Enterprisey}}, do you mean editing on behalf of a user or just authenticating that the user is that user? For the latter, I've already had some ideas about this for RW - so the script would generate a random token on the user side (the private token), have that be passed to toolforge which will store the token and also hand back a public token string which will then be used to make a public edit on Wikipedia somewhere, be it a config file or authentication page (similar to the way [[WP:DISCORD]] authenticates users). Then, the script will give the private token and the revision ID which will then link the user who made that edit to the owner of both the public and private token. From then on, the requests would be authenticated by including the private token in the request which is only known to the server and the client - the private token would be stored in a cookie or document storage so it's never made public, and when it expires the process will just run again - but this isn't the most secure solution, but I'd say its more ideal over handing auth cookies. Doing this means that authentication would be far less often. [[User:Ed6767|<span style="font-family:'Roboto',sans-serif;font-weight:300;text-shadow: 2px 2px 10px black;color:black;">Ed<span style="color:red;">6767</span></span>]] [[User talk:Ed6767|<span style="color:black;"><strong>talk!</strong></span>]] 18:09, 3 July 2020 (UTC)
::Made this horrible infographic too: [[File:RWToolforgeAuthDiagram.png|center|frameless]] [[User:Ed6767|<span style="font-family:'Roboto',sans-serif;font-weight:300;text-shadow: 2px 2px 10px black;color:black;">Ed<span style="color:red;">6767</span></span>]] [[User talk:Ed6767|<span style="color:black;"><strong>talk!</strong></span>]] 18:20, 3 July 2020 (UTC)
:::Looks good, and thanks for the infographic! (Very high-effort!) I will probably end up trying this if I can't find an existing solution. [[User:Enterprisey|Enterprisey]]&nbsp;([[User talk:Enterprisey|talk!]]) 01:31, 4 July 2020 (UTC)
:::Please [https://security.stackexchange.com/questions/168261/what-does-dont-roll-your-own-security-mean don't roll your own authentication system], it rarely ends well. --[[User:Tgr|Tgr]] ([[User talk:Tgr|talk]]) 20:01, 4 July 2020 (UTC)
:Further discussion, by the way, including another (component of a) solution, at [[meta:Tech#Authenticating a request from a user script to a toolforge tool]] ([[meta:Special:Permalink/20243665#Authenticating a request from a user script to a toolforge tool|permalink]]). [[User:Enterprisey|Enterprisey]]&nbsp;([[User talk:Enterprisey|talk!]]) 05:51, 4 July 2020 (UTC)