Does that bug you? It bugs me. Would it be possible to change script-installer to match {{subst:iusc}}'s output? (For that matter, is there a reason it doesn't just generate that subst in the first place? DRY and all that.) Gaelan💬✏️09:39, 24 February 2019 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"2019-02-24T09:39:00.000Z","author":"Gaelan","type":"comment","level":1,"id":"c-Gaelan-2019-02-24T09:39:00.000Z-Feature_request:_generate_code_that_matches_{{subst:iusc}}","replies":["c-Enterprisey-2019-10-13T06:28:00.000Z-Gaelan-2019-02-24T09:39:00.000Z","c-Andrybak-20240615205800-Gaelan-2019-02-24T09:39:00.000Z"]}}-->
Gaelan, is this still an issue? I checked your common.js and my common.js and couldn't see what you're talking about - I'm probably not understanding your comment. Enterprisey (talk!) 06:28, 13 October 2019 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"2019-10-13T06:28:00.000Z","author":"Enterprisey","type":"comment","level":2,"id":"c-Enterprisey-2019-10-13T06:28:00.000Z-Gaelan-2019-02-24T09:39:00.000Z","replies":["c-Enterprisey-2021-01-26T04:19:00.000Z-Enterprisey-2019-10-13T06:28:00.000Z"]}}-->
Oh, spacing inside the parentheses. Huh. Yeah, the subst would be fine. I don't feel very strongly about this. I guess I'll consider adding spaces. Enterprisey (talk!) 04:19, 26 January 2021 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"2021-01-26T04:19:00.000Z","author":"Enterprisey","type":"comment","level":3,"id":"c-Enterprisey-2021-01-26T04:19:00.000Z-Enterprisey-2019-10-13T06:28:00.000Z","replies":["c-Novem_Linguae-20240507174800-Enterprisey-2021-01-26T04:19:00.000Z"]}}-->
As of 2024, the gadget is not putting spaces inside parentheses. Judging from the lack of comments on this page, I don't think most users mind. Probably should leave as is. –Novem Linguae (talk) 17:48, 7 May 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240507174800","author":"Novem Linguae","type":"comment","level":4,"id":"c-Novem_Linguae-20240507174800-Enterprisey-2021-01-26T04:19:00.000Z","replies":[]}}-->
@Enterprisey: It would be neat if this script was extended to allow installing scripts on global.js, too. ~★ nmaiad01:05, 15 September 2020 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"2020-09-15T01:05:00.000Z","author":"NMaia","type":"comment","level":1,"id":"c-NMaia-2020-09-15T01:05:00.000Z-Global","replies":["c-Enterprisey-2021-08-13T23:53:00.000Z-NMaia-2020-09-15T01:05:00.000Z"]}}-->
Status: I have no plans to work on this, but would be happy to mentor someone if they wanted to work on it themselves. Enterprisey (talk!) 23:53, 13 August 2021 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"2021-08-13T23:53:00.000Z","author":"Enterprisey","type":"comment","level":2,"id":"c-Enterprisey-2021-08-13T23:53:00.000Z-NMaia-2020-09-15T01:05:00.000Z","replies":[]}}-->
With checkboxes. Enterprisey (talk!) 04:10, 26 January 2021 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"2021-01-26T04:10:00.000Z","author":"Enterprisey","type":"comment","level":1,"id":"c-Enterprisey-2021-01-26T04:10:00.000Z-TODO:_Bulk_deletion_support","replies":["c-Guarapiranga-2021-05-26T23:41:00.000Z-Enterprisey-2021-01-26T04:10:00.000Z"]}}-->
That'd be great!— 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚 (talk) 23:41, 26 May 2021 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"2021-05-26T23:41:00.000Z","author":"Guarapiranga","type":"comment","level":2,"id":"c-Guarapiranga-2021-05-26T23:41:00.000Z-Enterprisey-2021-01-26T04:10:00.000Z","replies":["c-Enterprisey-2021-08-13T23:53:00.000Z-Guarapiranga-2021-05-26T23:41:00.000Z"],"displayName":"\u2014 \ud835\udc06\ud835\udc2e\ud835\udc1a\ud835\udc2b\ud835\udc1a\ud835\udc29\ud835\udc22\ud835\udc2b\ud835\udc1a\ud835\udc27\ud835\udc20\ud835\udc1a"}}-->
Status: I have no plans to work on this, but would be happy to mentor someone if they wanted to work on it themselves. Enterprisey (talk!) 23:53, 13 August 2021 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"2021-08-13T23:53:00.000Z","author":"Enterprisey","type":"comment","level":3,"id":"c-Enterprisey-2021-08-13T23:53:00.000Z-Guarapiranga-2021-05-26T23:41:00.000Z","replies":[]}}-->
__DTSUBSCRIBEBUTTONDESKTOP__{"headingLevel":2,"name":"h-Nardog-2021-04-08T23:18:00.000Z","type":"heading","level":0,"id":"h-id_vs_data--2021-04-08T23:18:00.000Z","replies":["c-Nardog-2021-04-08T23:18:00.000Z-id_vs_data-"],"text":"id vs data-","linkableTitle":"id vs data-"}-->
__DTSUBSCRIBEBUTTONMOBILE__{"headingLevel":2,"name":"h-Nardog-2021-04-08T23:18:00.000Z","type":"heading","level":0,"id":"h-id_vs_data--2021-04-08T23:18:00.000Z","replies":["c-Nardog-2021-04-08T23:18:00.000Z-id_vs_data-"],"text":"id vs data-","linkableTitle":"id vs data-"}-->
I don't think relying on IDs for getting script paths is a good idea as it results in invalid HTML if the same path appears more than once per page. Shouldn't it use a data-* attribute? Nardog (talk) 23:18, 8 April 2021 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"2021-04-08T23:18:00.000Z","author":"Nardog","type":"comment","level":1,"id":"c-Nardog-2021-04-08T23:18:00.000Z-id_vs_data-","replies":[]}}-->
@Enterprisey: It would be helpful if you added a function allowing you to add scripts using scriptManager's syntax. ―Qwerfjkl | 𝕋𝔸𝕃𝕂 (please use {{reply to|Qwerfjkl}} on reply) 13:53, 23 May 2021 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"2021-05-23T13:53:00.000Z","author":"Qwerfjkl","type":"comment","level":1,"id":"c-Qwerfjkl-2021-05-23T13:53:00.000Z-scriptManager","replies":["c-Guarapiranga-2021-05-26T23:50:00.000Z-Qwerfjkl-2021-05-23T13:53:00.000Z"]}}-->
Agreed. — Guarapiranga (talk) 23:50, 26 May 2021 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"2021-05-26T23:50:00.000Z","author":"Guarapiranga","type":"comment","level":2,"id":"c-Guarapiranga-2021-05-26T23:50:00.000Z-Qwerfjkl-2021-05-23T13:53:00.000Z","replies":["c-Enterprisey-2021-08-13T23:53:00.000Z-Guarapiranga-2021-05-26T23:50:00.000Z"]}}-->
Status: I have no plans to work on this, but would be happy to mentor someone if they wanted to work on it themselves. Enterprisey (talk!) 23:53, 13 August 2021 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"2021-08-13T23:53:00.000Z","author":"Enterprisey","type":"comment","level":3,"id":"c-Enterprisey-2021-08-13T23:53:00.000Z-Guarapiranga-2021-05-26T23:50:00.000Z","replies":[]}}-->
__DTSUBSCRIBEBUTTONDESKTOP__{"headingLevel":2,"name":"h-Sdkb-2021-11-23T03:47:00.000Z","type":"heading","level":0,"id":"h-Lusc_instead_of_iusc-2021-11-23T03:47:00.000Z","replies":["c-Sdkb-2021-11-23T03:47:00.000Z-Lusc_instead_of_iusc"],"text":"Lusc instead of iusc","linkableTitle":"Lusc instead of iusc"}-->
__DTSUBSCRIBEBUTTONMOBILE__{"headingLevel":2,"name":"h-Sdkb-2021-11-23T03:47:00.000Z","type":"heading","level":0,"id":"h-Lusc_instead_of_iusc-2021-11-23T03:47:00.000Z","replies":["c-Sdkb-2021-11-23T03:47:00.000Z-Lusc_instead_of_iusc"],"text":"Lusc instead of iusc","linkableTitle":"Lusc instead of iusc"}-->
This script still seems to be using {{Iusc}}, rather than {{Lusc}}, which I understand to be the preferred method. Enterprisey, would it be possible to update that? {{u|Sdkb}}talk03:47, 23 November 2021 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"2021-11-23T03:47:00.000Z","author":"Sdkb","type":"comment","level":1,"id":"c-Sdkb-2021-11-23T03:47:00.000Z-Lusc_instead_of_iusc","replies":["c-Sportzpikachu-2021-12-10T10:45:00.000Z-Sdkb-2021-11-23T03:47:00.000Z"]}}-->
@Enterprisey: Any update on this? importScript() (which {{iusc}}) uses has been deprecated for a while now. See T95964 ―sportzpikachumy talkcontribs10:45, 10 December 2021 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"2021-12-10T10:45:00.000Z","author":"Sportzpikachu","type":"comment","level":2,"id":"c-Sportzpikachu-2021-12-10T10:45:00.000Z-Sdkb-2021-11-23T03:47:00.000Z","replies":["c-Enterprisey-2021-12-11T04:42:00.000Z-Sportzpikachu-2021-12-10T10:45:00.000Z"]}}-->
I plan to get to this at some point, but it's not urgent; there's still no good official replacement ("Gadgets 3.0" or whatever number they're on now). So it would just be for the slight performance benefit. Enterprisey (talk!) 04:42, 11 December 2021 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"2021-12-11T04:42:00.000Z","author":"Enterprisey","type":"comment","level":3,"id":"c-Enterprisey-2021-12-11T04:42:00.000Z-Sportzpikachu-2021-12-10T10:45:00.000Z","replies":["c-Novem_Linguae-20240507175200-Enterprisey-2021-12-11T04:42:00.000Z"]}}-->
Strong oppose. There was some misinformation going around a year or two ago that iusc was deprecated, but this had no basis in fact. See Template:Install user script#importScript() is not deprecated for more info. I strongly prefer iusc because it is much more readable. –Novem Linguae (talk) 17:52, 7 May 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240507175200","author":"Novem Linguae","type":"comment","level":4,"id":"c-Novem_Linguae-20240507175200-Enterprisey-2021-12-11T04:42:00.000Z","replies":["c-Sdkb-20240507180600-Novem_Linguae-20240507175200"]}}-->
I switched all my scripts to use {{Lusc}} in 2021 after I was told that it would significantly improve page loading speed, and at the time it seemed to do so. Is that no longer the case? Sdkbtalk18:06, 7 May 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240507180600","author":"Sdkb","type":"comment","level":5,"id":"c-Sdkb-20240507180600-Novem_Linguae-20240507175200","replies":["c-Novem_Linguae-20240507184500-Sdkb-20240507180600"]}}-->
Interesting. I haven't looked into the performance angle of this. –Novem Linguae (talk) 18:45, 7 May 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240507184500","author":"Novem Linguae","type":"comment","level":6,"id":"c-Novem_Linguae-20240507184500-Sdkb-20240507180600","replies":[]}}-->
@Enterprisey: Now that phab:T300743 is fixed, I can list the other to-do items that I noticed while looking for XSS issues. These are all suggestions for future development that you can take or leave as you see fit.
The gadget should check the content model of script pages before installing them, and only install ones with a content model of JavaScript. In theory, not checking this would allow an attacker to add JavaScript code to a wikitext page in a trusted user's userspace (which anyone can edit), and then trick the victim into installing the attacker's code while the victim believes it is written by the trusted user. In practice, this attack is stopped by MediaWiki setting the X-Content-Type-Options header to "nosniff", which prevents loading scripts from pages that don't have a MIME type of "text/javascript". This could be a problem in very old browsers though, so it would be worth fixing.
Import.fromJs is broken for scripts with double or single quotes in them (e.g. User:Example/foo"bar.js). The script trims the first quote character and everything after it, which means it tries to install e.g. User:Example/foo instead. Fixing this would mean parsing the string with a JavaScript parser instead of with regex - unfortunately, I'm not aware of an easy way of doing that without installing third-party libraries, so this could be a lot of work.
The cookie attributes of the open_script_installer need fixing. Firefox was giving the following warning in the console: Cookie “open_script_installer” will be soon rejected because it has the “SameSite” attribute set to “None” or an invalid value, without the “secure” attribute. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite.
There are some missing translation strings: see the latter half of the diff of the Chinese translation to see where they are. They also use different pipe and bracket characters, so those might be worth including as well. The mw.Message class might be worth a look into for this.
Best — Mr. Stradivarius♪ talk ♪13:33, 7 February 2022 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"2022-02-07T13:33:00.000Z","author":"Mr. Stradivarius","type":"comment","level":1,"id":"c-Mr._Stradivarius-2022-02-07T13:33:00.000Z-Various_to-dos","replies":[],"displayName":"Mr.\u00a0Stradivarius"}}-->
__DTSUBSCRIBEBUTTONDESKTOP__{"headingLevel":2,"name":"h-Jindam_vani-20221227135600","type":"heading","level":0,"id":"h-unable_to_uninstall_autoFormatter_&_cleanDiff-20221227135600","replies":["c-Jindam_vani-20221227135600-unable_to_uninstall_autoFormatter_&_cleanDiff"],"text":"unable to uninstall autoFormatter & cleanDiff","linkableTitle":"unable to uninstall autoFormatter & cleanDiff"}-->
__DTSUBSCRIBEBUTTONMOBILE__{"headingLevel":2,"name":"h-Jindam_vani-20221227135600","type":"heading","level":0,"id":"h-unable_to_uninstall_autoFormatter_&_cleanDiff-20221227135600","replies":["c-Jindam_vani-20221227135600-unable_to_uninstall_autoFormatter_&_cleanDiff"],"text":"unable to uninstall autoFormatter & cleanDiff","linkableTitle":"unable to uninstall autoFormatter & cleanDiff"}-->
@Enterprisey: i am unable to uninstall
both autoFormatter & cleanDiff on common.js.
can you please look into it. <_> jindam, vani (talk) 13:56, 27 December 2022 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20221227135600","author":"Jindam vani","type":"comment","level":1,"id":"c-Jindam_vani-20221227135600-unable_to_uninstall_autoFormatter_&_cleanDiff","replies":["c-Novem_Linguae-20240507175500-Jindam_vani-20221227135600"],"displayName":"jindam, vani"}}-->
Links: meta:User:TMg/autoFormatter, de:Benutzer:TMg/cleanDiff.js. These are both non-English Wikipedia user scripts, which is probably why this gadget didn't work. –Novem Linguae (talk) 17:55, 7 May 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240507175500","author":"Novem Linguae","type":"comment","level":2,"id":"c-Novem_Linguae-20240507175500-Jindam_vani-20221227135600","replies":[]}}-->
__DTSUBSCRIBEBUTTONDESKTOP__{"headingLevel":2,"name":"h-Aaron_Liu-20230913165600","type":"heading","level":0,"id":"h-Recognize_Full_Protection-20230913165600","replies":["c-Aaron_Liu-20230913165600-Recognize_Full_Protection"],"text":"Recognize Full Protection","linkableTitle":"Recognize Full Protection"}-->
__DTSUBSCRIBEBUTTONMOBILE__{"headingLevel":2,"name":"h-Aaron_Liu-20230913165600","type":"heading","level":0,"id":"h-Recognize_Full_Protection-20230913165600","replies":["c-Aaron_Liu-20230913165600-Recognize_Full_Protection"],"text":"Recognize Full Protection","linkableTitle":"Recognize Full Protection"}-->
@Enterprisey Currently, the script claims that Wikipedia:AutoEd/complete.js is insecure, in spite of the full protection. Could support be added? Aaron Liu (talk) 16:56, 13 September 2023 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20230913165600","author":"Aaron Liu","type":"comment","level":1,"id":"c-Aaron_Liu-20230913165600-Recognize_Full_Protection","replies":[]}}-->
__DTSUBSCRIBEBUTTONDESKTOP__{"headingLevel":2,"name":"h-Andrybak-20240604131100","type":"heading","level":0,"id":"h-Should_script-installer_add_userscript_pages_to_the_watchlist?-20240604131100","replies":["c-Andrybak-20240604131100-Should_script-installer_add_userscript_pages_to_the_watchlist?","c-Andrybak-20240628222700-Should_script-installer_add_userscript_pages_to_the_watchlist?"],"text":"Should script-installer add userscript pages to the watchlist?","linkableTitle":"Should script-installer add userscript pages to the watchlist?"}-->
Should script-installer add userscript pages to the watchlist?
__DTSUBSCRIBEBUTTONMOBILE__{"headingLevel":2,"name":"h-Andrybak-20240604131100","type":"heading","level":0,"id":"h-Should_script-installer_add_userscript_pages_to_the_watchlist?-20240604131100","replies":["c-Andrybak-20240604131100-Should_script-installer_add_userscript_pages_to_the_watchlist?","c-Andrybak-20240628222700-Should_script-installer_add_userscript_pages_to_the_watchlist?"],"text":"Should script-installer add userscript pages to the watchlist?","linkableTitle":"Should script-installer add userscript pages to the watchlist?"}-->
Working on userscripts sometimes requires discussion. Because script-installer is a gadget, this talk page is relatively active, but this is not true for all userscripts. In a recent case, I posted on the talk page of the author, because the script didn't have an existing talk page (both documentation and the code talk pages don't exist at the time of writing). However, in another case I created a talk page corresponding to the script's documentation page and pinged the author.
Technically, due to backlinks generated by automatic script installation, I could figure out all the users, but pinging or messaging them would be way too much spam, which is disruptive.
What if script-installer automatically added/removed the pages (documentation and .js) of a userscript being installed/uninstalled to the watchlist? This would keep the users informed of any updates that might affect them, and maybe encourage their participation in discussions.
On the other hand, such automatic meddling with the watchlist might annoy some users. —andrybak (talk) 13:11, 4 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240604131100","author":"Andrybak","type":"comment","level":1,"id":"c-Andrybak-20240604131100-Should_script-installer_add_userscript_pages_to_the_watchlist?","replies":["c-Qwerfjkl-20240604162400-Andrybak-20240604131100","c-Novem_Linguae-20240604163900-Andrybak-20240604131100"]}}-->
Andrybak, it could be added as a default-on preference that can be configured in the common.js/skin.js page, like nav popups has. — Qwerfjkltalk16:24, 4 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240604162400","author":"Qwerfjkl","type":"comment","level":2,"id":"c-Qwerfjkl-20240604162400-Andrybak-20240604131100","replies":[]}}-->
Is the proposal to automatically add to your watchlist any user script installed with this gadget? I wouldn't personally be interested in that. I've installed around 50 user scripts, I think, and I don't have a reason for them to be on my watchlist. Please correct me if I'm misunderstanding. –Novem Linguae (talk) 16:39, 4 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240604163900","author":"Novem Linguae","type":"comment","level":2,"id":"c-Novem_Linguae-20240604163900-Andrybak-20240604131100","replies":["c-Andrybak-20240604165200-Novem_Linguae-20240604163900"]}}-->
Your understanding of the proposal is correct. With Qwerfjkl's preference idea, it will be possible to disable this functionality. —andrybak (talk) 16:52, 4 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240604165200","author":"Andrybak","type":"comment","level":3,"id":"c-Andrybak-20240604165200-Novem_Linguae-20240604163900","replies":[]}}-->
I have implemented this proposal in my sandbox: Special:Diff/1231540064/1231548208. During installation, the gadget will automatically add the source code page (example: User:Shubinator/DYKcheck.js) and the documentation page (example: User:Shubinator/DYKcheck) to the watchlist. During uninstallation, the gadget will automatically remove the pages from the watchlist.
The customization of this automatic watching/unwatching feature can be done via two new options:
There are two options rather than one, because there are use-cases for all four combinations:
the default is both automatic watching and automatic unwatching are enabled – for users who want to keep track only of scripts they currently have installed
disable only watching for people who don't want scripts on their watchlists (≈ Novem Linguae's use-case)
disable only unwatching for people who want to keep tabs on scripts that they've uninstalled, but, for example, might want to install in the future, when it shows up in their watchlist
disable both watching and unwatching for people who want to control their watchlist manually (current status quo)
What do you think? —andrybak (talk) 22:27, 28 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240628222700","author":"Andrybak","type":"comment","level":1,"id":"c-Andrybak-20240628222700-Should_script-installer_add_userscript_pages_to_the_watchlist?","replies":["c-Novem_Linguae-20240628223100-Andrybak-20240628222700","c-Nardog-20240630013100-Andrybak-20240628222700"]}}-->
Talk page watchers, is anyone else interested in this feature? I do not think this should default to on without consensus, and maybe not even be included at all without consensus (since if this were to be mostly unused, it would increase technical debt) –Novem Linguae (talk) 22:31, 28 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240628223100","author":"Novem Linguae","type":"comment","level":2,"id":"c-Novem_Linguae-20240628223100-Andrybak-20240628222700","replies":["c-Qwerfjkl-20240629210000-Novem_Linguae-20240628223100"]}}-->
Novem Linguae, I can't imagine ever using something like this, but I'm probably in the minority when it comes to using scripts. — Qwerfjkltalk21:00, 29 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240629210000","author":"Qwerfjkl","type":"comment","level":3,"id":"c-Qwerfjkl-20240629210000-Novem_Linguae-20240628223100","replies":[]}}-->
I would be strongly opposed to making it the default (opt-out). Script users often don't understand (or forget over time) which script is responsible for which part of their site experience, and adding the script/doc to their watchlists may overburden (and eventually discourage) script authors when something goes wrong. Instead lead them to WP:VPT, where help (e.g. forking) is more likely to be found. Nardog (talk) 01:31, 30 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240630013100","author":"Nardog","type":"comment","level":2,"id":"c-Nardog-20240630013100-Andrybak-20240628222700","replies":[]}}-->
__DTSUBSCRIBEBUTTONDESKTOP__{"headingLevel":2,"name":"h-Andrybak-20240607122700","type":"heading","level":0,"id":"h-Confusing_history_of_importScript-20240607122700","replies":["c-Andrybak-20240607122700-Confusing_history_of_importScript","h-Timeline_of_importScript-Confusing_history_of_importScript-20240607122700","h-Discussion_\u2013_Confusing_history_of_importScript-Confusing_history_of_importScript-20240607122700"],"text":"Confusing history of importScript","linkableTitle":"Confusing history of importScript"}-->
__DTSUBSCRIBEBUTTONMOBILE__{"headingLevel":2,"name":"h-Andrybak-20240607122700","type":"heading","level":0,"id":"h-Confusing_history_of_importScript-20240607122700","replies":["c-Andrybak-20240607122700-Confusing_history_of_importScript","h-Timeline_of_importScript-Confusing_history_of_importScript-20240607122700","h-Discussion_\u2013_Confusing_history_of_importScript-Confusing_history_of_importScript-20240607122700"],"text":"Confusing history of importScript","linkableTitle":"Confusing history of importScript"}-->
Due to some confusing discussions around functions importScript and mw.loader.load, I have attempted to reconstruct the events, which lead to the confusion.
I've considered different places for this discussion. The most automated way of installing script nowadays is the installer gadget, so I selected this talk page. —andrybak (talk) 12:27, 7 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240607122700","author":"Andrybak","type":"comment","level":1,"id":"c-Andrybak-20240607122700-Confusing_history_of_importScript","replies":[]}}-->
Timeline of importScript
2008: Brooke Vibber (aka Brooke Vibber (WMF)) adds function importScript to file wikibits.js in commit 36b1931: (bug 13232) importScript(), importStylesheet() funcs available to custom JS
Though deprecated, it is expected that a next version of resource loader (which will be more focused on userscripts) will bring a true replacement for importScript().
If you are looking to update your scripts to not use deprecated functions, and come across calls to "importScript" and "importStylesheet", you are free to just keep using those the way they are. You don't have to fear them being removed, that will not happen until after a better replacement exists.
Per result of this discussion, User:קיפודנחשadds the following text to the page "ResourceLoader/Legacy JavaScript":
importScript // importStylesheet // There two functions are not quite deprecated yet, but are planned to be, once a suitable modern substitute is found. See bugzilla:25845 and bugzilla:27281
importScript() (which {{iusc}}) uses has been deprecated for a while now. See T95964
2022
On 2022-08-05, Krinkle in commit 51155b0 (aka gerrit:820828) moves the function importScript from wikibits.js to mediawiki.base.js, quote:
Move the non-deprecated importScript (not the deprecated "URI" variants) functions to mediawiki.base, and cover them with tests.
Accordingly, Krinkle removesimportScript from the aforementioned table of deprecated functions with edit summary: importScript has never been deprecated, no warnigns, source explicilty states otherwise, no intention to remove.
ResourceLoader: Remove $wgIncludeLegacyJavaScript and simplify code
[...] importScript: Never deprecated in the first place as there is no mw.loader equivalent to this. In order to achieve optimal cache performance, and benefit from automatic purging after edits, one must craft a very specificly encoded and ordered canonical action=raw URL. This is not something end-users need to know about, and is what imporScript exists for to abstract. Plus, it ensures de-duplication. One day something like Gadgets 3.0 (T36958) might take off, but for many years to come, importScript remains the best and only supported and usable means within the platform to share and load user scripts.
On 2022-10-29, MacFan4000adds the corresponding release note for MediaWiki 1.39.0, which was released at the end of November (underlining mine):
Removed configuration [...] $wgIncludeLegacyJavaScript has been removed. Note that no functionality was removed in this release. Most former "wikibits" functions were removed after deprecation in previous releases. The remaining functions, such as importScript, are available unconditionally.
Feel free to edit this timeline if you find mistakes, anything relevant turns up, or to improve formatting. —andrybak (talk) 12:27, 7 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240607122700","author":"Andrybak","type":"comment","level":1,"id":"c-Andrybak-20240607122700-Timeline_of_importScript","replies":["c-Andrybak-20240607123500-Andrybak-20240607122700","c-Andrybak-20240607132900-Andrybak-20240607122700"]}}-->
Added Gerrit links corresponding to the existing Phabricator links for commits. —andrybak (talk) 18:24, 7 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240607182400","author":"Andrybak","type":"comment","level":3,"id":"c-Andrybak-20240607182400-Andrybak-20240607123500","replies":["c-Andrybak-20240607201600-Andrybak-20240607182400"]}}-->
Added quote from 2022-09-01 commit. —andrybak (talk) 20:16, 7 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240607201600","author":"Andrybak","type":"comment","level":4,"id":"c-Andrybak-20240607201600-Andrybak-20240607182400","replies":["c-Andrybak-20240804131100-Andrybak-20240607201600"]}}-->
Would it be helpful to color code the timeline? Something like or Ng for situations when the person thought the function was deprecated and Y for when they didn't. —andrybak (talk) 13:29, 7 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240607132900","author":"Andrybak","type":"comment","level":2,"id":"c-Andrybak-20240607132900-Andrybak-20240607122700","replies":[]}}-->
Discussion – Confusing history of importScript
It seems that most of the confusion was caused by the discrepancies between three sources of information: source code, mw:ResourceLoader/Legacy JavaScript, and mw:ResourceLoader/Migration guide (users). Hopefully this will clear up any confusion and clarify why people were confused. Let me know, if there are any other discussions.
Courtesy pings to other participants of discussions and tickets: He7d3r, Skizzerz, Gary, Mdowdell. —andrybak (talk) 12:27, 7 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240607122700","author":"Andrybak","type":"comment","level":1,"id":"c-Andrybak-20240607122700-Discussion_\u2013_Confusing_history_of_importScript","replies":["c-Andrybak-20240607130000-Andrybak-20240607122700","c-Andrybak-20240607130700-Andrybak-20240607122700"]}}-->
That's a lot of pings. Does this issue need all this attention? I feel it has been resolved for a year or two. –Novem Linguae (talk) 13:34, 7 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240607133400","author":"Novem Linguae","type":"comment","level":3,"id":"c-Novem_Linguae-20240607133400-Andrybak-20240607130700","replies":["c-Andrybak-20240607134900-Novem_Linguae-20240607133400","c-Sportzpikachu-20240607142000-Novem_Linguae-20240607133400"]}}-->
Maybe it doesn't. I'm trying to ensure that the misinformation doesn't spread. For me personally, the starting point was Izno's 2021 comment (i.e. I was thinking it was deprecated), so this wall of text started as a draft for a message on his talk page asking for clarification, because I couldn't find what he was referring to about MediaWiki 1.29. I also had a vague memory of your Special:Diff/1222746631Special:Diff/1222747277, but I failed to find it for a long time during the investigation. —andrybak (talk) 13:49, 7 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240607134900","author":"Andrybak","type":"comment","level":4,"id":"c-Andrybak-20240607134900-Novem_Linguae-20240607133400","replies":["c-Andrybak-20240901001900-Andrybak-20240607134900"]}}-->
Fixed incorrect diff link in this old message of mine. —andrybak (talk) 00:19, 1 September 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240901001900","author":"Andrybak","type":"comment","level":5,"id":"c-Andrybak-20240901001900-Andrybak-20240607134900","replies":[]}}-->
Thanks @andrybak for putting together the very detailed history. At the time I added that comment I thought importScript had been deprecated (don't remember where I got that from tbh), but @Novem Linguae has already clarified that above. However I do agree with @Novem Linguae that there isn't much left to do regarding importScript vs mw.loader.load. ―sportzpikachumy talkcontribs14:20, 7 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240607142000","author":"Sportzpikachu","type":"comment","level":4,"id":"c-Sportzpikachu-20240607142000-Novem_Linguae-20240607133400","replies":["c-Sdkb-20240607154800-Sportzpikachu-20240607142000"]}}-->
I'm still curious whether there's any performance difference between the two options. If not, importScript is certainly cleaner. Sdkbtalk15:48, 7 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240607154800","author":"Sdkb","type":"comment","level":5,"id":"c-Sdkb-20240607154800-Sportzpikachu-20240607142000","replies":["c-SD0001-20240608060500-Sdkb-20240607154800"]}}-->
There is no performance difference (and there never was). Both functions use exactly the same mechanism for loading a script. Furthermore, if the same script is importScripted twice, it only loads once – which is not the case while using mw.loader.load, so in a way importScript is faster. – SD0001 (talk) 06:05, 8 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240608060500","author":"SD0001","type":"comment","level":6,"id":"c-SD0001-20240608060500-Sdkb-20240607154800","replies":["c-Jonesey95-20240611013400-SD0001-20240608060500"]}}-->
That is an impressive history. Nice detective work. – Jonesey95 (talk) 01:34, 11 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240611013400","author":"Jonesey95","type":"comment","level":7,"id":"c-Jonesey95-20240611013400-SD0001-20240608060500","replies":[]}}-->
importScript() is not deprecated but it will be. Seeing from the patches such as gerrit:206078 and gerrit:203293 the intent is clear. Further use will make the migration harder in the future. Ladsgroupoverleg18:06, 7 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240607180600","author":"Ladsgroup","type":"comment","level":3,"id":"c-Ladsgroup-20240607180600-Andrybak-20240607130700","replies":["c-Andrybak-20240607181800-Ladsgroup-20240607180600","c-Novem_Linguae-20240607193600-Ladsgroup-20240607180600","c-SD0001-20240608061000-Ladsgroup-20240607180600"]}}-->
Ladsgroup, the Gerrit links you've provided correspond to the items for year 2015 in the timeline above – I've used slightly different view via Phabricator*. Note the chronological order of these two patches:
Apr 14, 2015 gerrit:203293 "wikibits: Mark importScript/importStylesheet utilities as deprecated"
Apr 23, 2015 gerrit:206078 "wikibits: Un-deprecate importScript and importStylesheet // Per discussion on T95964. No suitable replacement exists yet."
* in addition to Gerrit and Phabricator, there is also the third view via Gitiles (which is integrated into Gerrit): 5c5e090 (wikibits: Mark importScript/importStylesheet utilities as deprecated, 2015-04-11), 8eb99c9 (wikibits: Un-deprecate importScript and importStylesheet, 2015-04-23). The dates can be confusing, because there are three of them for each patch/commit: author date, committer date, and submitted.
Hope this helps. —andrybak (talk) 18:18, 7 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240607181800","author":"Andrybak","type":"comment","level":4,"id":"c-Andrybak-20240607181800-Ladsgroup-20240607180600","replies":[]}}-->
importScript has major code readability advantages over mw.loader.load. I definitely hope it is never deprecated. If it comes up in phab or gerrit I plan to share my opinion.
The author of gerrit:203293 mentioned above later said For local imports, call importScript(). This is not, and never was, deprecated. For cross-wiki and other less trivial use cases, call mw.loader.load(), which makes me wonder if there is still an intent to deprecate it. –Novem Linguae (talk) 19:36, 7 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240607193600","author":"Novem Linguae","type":"comment","level":4,"id":"c-Novem_Linguae-20240607193600-Ladsgroup-20240607180600","replies":["c-Andrybak-20240607203300-Novem_Linguae-20240607193600"]}}-->
I've added another relevant commit to the timeline, which mentions mw:Gadgets 3.0 (phab:T36958), and suggests that importScript is here to stay for quite a long time.
For context, the ticket for Gadgets 2.0 – phab:T31272: is still in status "Open", because it seems to be waiting on T153339, T125582, T31398, and T110014. However, a lot of other subtasks of T31272 are already implemented. T31272 also links to mw:Extension:Gadgets/Roadmap, which is marked as obsolete, which is confusing. The latest comments under T31272 are from April 2024 with consideration to integrate Gadgets 2.0 into an even bigger project – mw:Growth/Community configuration (phab:T323811), but this integration doesn't seem to have happened – the gadgets are only mentioned in T323811 under "Possible usecases". —andrybak (talk) 20:33, 7 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240607203300","author":"Andrybak","type":"comment","level":5,"id":"c-Andrybak-20240607203300-Novem_Linguae-20240607193600","replies":[]}}-->
The undeprecation patch is a decade old and mentions "no suitable replacement exists" - which still holds true. It's not like it will be deprecated until a replacement exists - which arguably is Gadgets 3 (phab:T36958). – SD0001 (talk) 06:10, 8 June 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240608061000","author":"SD0001","type":"comment","level":4,"id":"c-SD0001-20240608061000-Ladsgroup-20240607180600","replies":[]}}-->
__DTSUBSCRIBEBUTTONDESKTOP__{"headingLevel":2,"name":"h-JWBTH-20240713155000","type":"heading","level":0,"id":"h-\"Normalize\"_function_breaks_CSS_imports-20240713155000","replies":["c-JWBTH-20240713155000-\"Normalize\"_function_breaks_CSS_imports"],"text":"\"Normalize\" function breaks CSS imports","linkableTitle":"\"Normalize\" function breaks CSS imports"}-->
__DTSUBSCRIBEBUTTONMOBILE__{"headingLevel":2,"name":"h-JWBTH-20240713155000","type":"heading","level":0,"id":"h-\"Normalize\"_function_breaks_CSS_imports-20240713155000","replies":["c-JWBTH-20240713155000-\"Normalize\"_function_breaks_CSS_imports"],"text":"\"Normalize\" function breaks CSS imports","linkableTitle":"\"Normalize\" function breaks CSS imports"}-->
EditJack who built the house (talk) 15:50, 13 July 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240713155000","author":"JWBTH","type":"comment","level":1,"id":"c-JWBTH-20240713155000-\"Normalize\"_function_breaks_CSS_imports","replies":["c-Andrybak-20240713185400-JWBTH-20240713155000"],"displayName":"Jack who built the house"}}-->
Looking at documentation of function mw.loader.load, it seems that just avoiding spaces inside the quoted 'string' or "string" of the parameter could be enough: Special:Diff/1234315858.
A more radical, more hacky approach is to remember which quotation marks—single ' or double "—were used and check if the part of the match, where we're expecting a singular parameter, includes the remembered quotation mark: Special:Diff/1231549277/1234730968. —andrybak (talk) 18:54, 13 July 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240713185400","author":"Andrybak","type":"comment","level":2,"id":"c-Andrybak-20240713185400-JWBTH-20240713155000","replies":[]}}-->
__DTSUBSCRIBEBUTTONDESKTOP__{"headingLevel":2,"name":"h-JWBTH-20240816124100","type":"heading","level":0,"id":"h-Add_user-select:_none_to_#script-installer-top-container-20240816124100","replies":["c-JWBTH-20240816124100-Add_user-select:_none_to_#script-installer-top-container"],"text":"Add user-select: none to #script-installer-top-container","linkableTitle":"Add user-select: none to #script-installer-top-container"}-->
Add user-select: none to #script-installer-top-container
__DTSUBSCRIBEBUTTONMOBILE__{"headingLevel":2,"name":"h-JWBTH-20240816124100","type":"heading","level":0,"id":"h-Add_user-select:_none_to_#script-installer-top-container-20240816124100","replies":["c-JWBTH-20240816124100-Add_user-select:_none_to_#script-installer-top-container"],"text":"Add user-select: none to #script-installer-top-container","linkableTitle":"Add user-select: none to #script-installer-top-container"}-->
Otherwise, when selecting the page title, the selection spreads to the script's links:
Jack who built the house (talk) 12:41, 16 August 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240816124100","author":"JWBTH","type":"comment","level":1,"id":"c-JWBTH-20240816124100-Add_user-select:_none_to_#script-installer-top-container","replies":["c-Andrybak-20240821000500-JWBTH-20240816124100","c-Novem_Linguae-20240827215600-JWBTH-20240816124100"],"displayName":"Jack who built the house"}}-->
I've been using it in my sandbox version. Seems good so far, no issues found. —andrybak (talk) 00:05, 21 August 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240821000500","author":"Andrybak","type":"comment","level":2,"id":"c-Andrybak-20240821000500-JWBTH-20240816124100","replies":[]}}-->
Is there something wrong with making links selectable? This is the standard behavior for almost all links on websites, right? Might be counter-intuitive to turn it off. –Novem Linguae (talk) 21:56, 27 August 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240827215600","author":"Novem Linguae","type":"comment","level":2,"id":"c-Novem_Linguae-20240827215600-JWBTH-20240816124100","replies":["c-JWBTH-20240827235900-Novem_Linguae-20240827215600","c-SD0001-20240828151200-Novem_Linguae-20240827215600"]}}-->
I think this is pretty much like how .mw-editsection [ edit | edit source ] has user-select: none. Jack who built the house (talk) 23:59, 27 August 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240827235900","author":"JWBTH","type":"comment","level":3,"id":"c-JWBTH-20240827235900-Novem_Linguae-20240827215600","replies":[],"displayName":"Jack who built the house"}}-->
It makes copying the page title harder, as triple-clicking it also ends up selecting the install link. This is different from, for instance, how you can triple-click a section header to select just the header, not the edit links. – SD0001 (talk) 15:12, 28 August 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240828151200","author":"SD0001","type":"comment","level":3,"id":"c-SD0001-20240828151200-Novem_Linguae-20240827215600","replies":["c-Pppery-20241109161500-SD0001-20240828151200"]}}-->
Done (except I added it to the CSS rather than the JS) * Pppery *it has begun...16:15, 9 November 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20241109161500","author":"Pppery","type":"comment","level":4,"id":"c-Pppery-20241109161500-SD0001-20240828151200","replies":[],"displayName":"* Pppery *"}}-->
__DTSUBSCRIBEBUTTONDESKTOP__{"headingLevel":2,"name":"h-Awesome_Aasim-20240820165700","type":"heading","level":0,"id":"h-Interface-protected_edit_request_on_20_August_2024-20240820165700","replies":["c-Awesome_Aasim-20240820165700-Interface-protected_edit_request_on_20_August_2024","c-Awesome_Aasim-20241122201500-Interface-protected_edit_request_on_20_August_2024"],"text":"Interface-protected edit request on 20 August 2024","linkableTitle":"Interface-protected edit request on 20 August 2024"}-->
Interface-protected edit request on 20 August 2024
__DTSUBSCRIBEBUTTONMOBILE__{"headingLevel":2,"name":"h-Awesome_Aasim-20240820165700","type":"heading","level":0,"id":"h-Interface-protected_edit_request_on_20_August_2024-20240820165700","replies":["c-Awesome_Aasim-20240820165700-Interface-protected_edit_request_on_20_August_2024","c-Awesome_Aasim-20241122201500-Interface-protected_edit_request_on_20_August_2024"],"text":"Interface-protected edit request on 20 August 2024","linkableTitle":"Interface-protected edit request on 20 August 2024"}-->
This will convert underscores to spaces, which will prevent duplicate script installs and false reports that a script that is installed isn't installed. AwesomeAasim16:57, 20 August 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240820165700","author":"Awesome Aasim","type":"comment","level":1,"id":"c-Awesome_Aasim-20240820165700-Interface-protected_edit_request_on_20_August_2024","replies":["c-Nardog-20240821014300-Awesome_Aasim-20240820165700","c-Writ_Keeper-20240831170200-Awesome_Aasim-20240820165700"],"displayName":"Awesome"}}-->
Use .replace(/_/g, " ") instead of .replaceAll("_", " "), which is not supported by some Grade A browsers. Nardog (talk) 01:43, 21 August 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240821014300","author":"Nardog","type":"comment","level":2,"id":"c-Nardog-20240821014300-Awesome_Aasim-20240820165700","replies":["c-SD0001-20240827105000-Nardog-20240821014300"]}}-->
Also per the style followed in the script, the space should be in single quotes. – SD0001 (talk) 10:50, 27 August 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240827105000","author":"SD0001","type":"comment","level":3,"id":"c-SD0001-20240827105000-Nardog-20240821014300","replies":[]}}-->
@Awesome Aasim:: Do you have an example of this actually occurring in the wild? From my brief testing, it looks like the element id that this is keying off of is alredy normalized with respect to spaces/underscores. Writ Keeper⚇♔17:02, 31 August 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240831170200","author":"Writ Keeper","type":"comment","level":2,"id":"c-Writ_Keeper-20240831170200-Awesome_Aasim-20240820165700","replies":["c-Awesome_Aasim-20240831174900-Writ_Keeper-20240831170200"],"displayName":"Writ\u00a0Keeper"}}-->
@Writ Keeper It is happening to me. I install a script and in some places it shows as not installed and in other places it shows as installed. It is a mess. AwesomeAasim17:49, 31 August 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240831174900","author":"Awesome Aasim","type":"comment","level":3,"id":"c-Awesome_Aasim-20240831174900-Writ_Keeper-20240831170200","replies":["c-Writ_Keeper-20240831211700-Awesome_Aasim-20240831174900"],"displayName":"Awesome"}}-->
I was looking for some specifics. What script, where are you seeing this, where are you not seeing this, etc. Writ Keeper⚇♔21:17, 31 August 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240831211700","author":"Writ Keeper","type":"comment","level":4,"id":"c-Writ_Keeper-20240831211700-Awesome_Aasim-20240831174900","replies":["c-Awesome_Aasim-20240831231000-Writ_Keeper-20240831211700"],"displayName":"Writ\u00a0Keeper"}}-->
I just created an example script to demonstrate my point. See User:Awesome Aasim/example script.js and User:Awesome Aasim/example script. AwesomeAasim23:10, 31 August 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240831231000","author":"Awesome Aasim","type":"comment","level":5,"id":"c-Awesome_Aasim-20240831231000-Writ_Keeper-20240831211700","replies":["c-Writ_Keeper-20240901005300-Awesome_Aasim-20240831231000"],"displayName":"Awesome"}}-->
That works correctly for me. What behavior are you seeing that seems wrong? Writ Keeper⚇♔00:53, 1 September 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240901005300","author":"Writ Keeper","type":"comment","level":6,"id":"c-Writ_Keeper-20240901005300-Awesome_Aasim-20240831231000","replies":["c-Awesome_Aasim-20240901023000-Writ_Keeper-20240901005300"],"displayName":"Writ\u00a0Keeper"}}-->
For one, the script shows with underscores. The other, the script shows with spaces. See [1]. AwesomeAasim02:30, 1 September 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240901023000","author":"Awesome Aasim","type":"comment","level":7,"id":"c-Awesome_Aasim-20240901023000-Writ_Keeper-20240901005300","replies":["c-Pppery-20241109161600-Awesome_Aasim-20240901023000"],"displayName":"Awesome"}}-->
Not done There does not seem to be sufficient agreement here to make an edit to a widely used gadget. * Pppery *it has begun...16:16, 9 November 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20241109161600","author":"Pppery","type":"comment","level":8,"id":"c-Pppery-20241109161600-Awesome_Aasim-20240901023000","replies":["c-Awesome_Aasim-20241122195100-Pppery-20241109161600","c-Awesome_Aasim-20241122195200-Pppery-20241109161600"],"displayName":"* Pppery *"}}-->
I don't think consensus is needed to fix an obvious bug. User:Nardog seems to have a good suggestion. AwesomeAasim19:51, 22 November 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20241122195100","author":"Awesome Aasim","type":"comment","level":9,"id":"c-Awesome_Aasim-20241122195100-Pppery-20241109161600","replies":[],"displayName":"Awesome"}}-->
Ping User:Nardog for above. AwesomeAasim19:52, 22 November 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20241122195200","author":"Awesome Aasim","type":"comment","level":9,"id":"c-Awesome_Aasim-20241122195200-Pppery-20241109161600","replies":[],"displayName":"Awesome"}}-->
So after a bit of testing, I found the culprit. There are several places where there can potentially be underscores in the title. One of them is the "href" attribute linking back to the script.
After assigning scriptName, replacing all the underscores with spaces seems to work. Reopening this edit request with two things:
scriptName=scriptName.replace(/_/g,' ');// if the script name happens to contain underscores, this purges it
See [2]. AwesomeAasim20:15, 22 November 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20241122201500","author":"Awesome Aasim","type":"comment","level":1,"id":"c-Awesome_Aasim-20241122201500-Interface-protected_edit_request_on_20_August_2024","replies":["c-Pppery-20241123001400-Awesome_Aasim-20241122201500","c-Sohom_Datta-20241127142300-Awesome_Aasim-20241122201500","c-Sohom_Datta-20241130030000-Awesome_Aasim-20241122201500"],"displayName":"Awesome"}}-->
I'm not going to decline this request twice, because that's poor form, but the discussion with Writ Keeper above shows that this clearly is not an obvious bug. * Pppery *it has begun...00:14, 23 November 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20241123001400","author":"Pppery","type":"comment","level":2,"id":"c-Pppery-20241123001400-Awesome_Aasim-20241122201500","replies":["c-Awesome_Aasim-20241123180000-Pppery-20241123001400"],"displayName":"* Pppery *"}}-->
When it is pulling from the href property of an element it will contain underscores instead of spaces. AwesomeAasim18:00, 23 November 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20241123180000","author":"Awesome Aasim","type":"comment","level":3,"id":"c-Awesome_Aasim-20241123180000-Pppery-20241123001400","replies":["c-Sohom_Datta-20241127040800-Awesome_Aasim-20241123180000"],"displayName":"Awesome"}}-->
@Awesome Aasim Could you throw a more fleshed out reproduction steps of what you are seeing (and the steps you used to reproduce this error/issue) (ping me when you do) Sohom (talk) 04:08, 27 November 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20241127040800","author":"Sohom Datta","type":"comment","level":4,"id":"c-Sohom_Datta-20241127040800-Awesome_Aasim-20241123180000","replies":["c-Awesome_Aasim-20241127042100-Sohom_Datta-20241127040800"],"displayName":"Sohom"}}-->
If I install from the infobox it puts underscores in the install. If I install from the script page it does not. And the install with underscores does not cause the script page to update from "install" to "uninstall", and vice versa. This fix fixes this. AwesomeAasim04:21, 27 November 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20241127042100","author":"Awesome Aasim","type":"comment","level":5,"id":"c-Awesome_Aasim-20241127042100-Sohom_Datta-20241127040800","replies":[],"displayName":"Awesome"}}-->
Partly done: After debugging, I implemented the second suggestion (on line 610). There isn't any evidence of what the first suggestion fixes, as a result, I am declining to implement that fix.
@Awesome Aasim Consider this a formal warning to include a concrete reproduction case of the problem with each edit request and test your fixes before making the edit request (both of which were missing from this request). Sohom (talk) 14:23, 27 November 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20241127142300","author":"Sohom Datta","type":"comment","level":2,"id":"c-Sohom_Datta-20241127142300-Awesome_Aasim-20241122201500","replies":["c-Awesome_Aasim-20241127165200-Sohom_Datta-20241127142300","c-Awesome_Aasim-20241127165300-Sohom_Datta-20241127142300","c-Awesome_Aasim-20241127165400-Sohom_Datta-20241127142300"],"displayName":"Sohom"}}-->
@Sohom Datta I already did some testing, using safemode and the F12 developer tools. I should have included screenshots and screencasts but those are kind of hard to include without having to upload a file to Commons. I'll try to find a way to get a screen capture visible to you next time so you can see next time. AwesomeAasim16:52, 27 November 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20241127165200","author":"Awesome Aasim","type":"comment","level":3,"id":"c-Awesome_Aasim-20241127165200-Sohom_Datta-20241127142300","replies":[],"displayName":"Awesome"}}-->
If indeed only the second one needed fixing, then that is good. Many thanks. AwesomeAasim16:53, 27 November 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20241127165300","author":"Awesome Aasim","type":"comment","level":3,"id":"c-Awesome_Aasim-20241127165300-Sohom_Datta-20241127142300","replies":[],"displayName":"Awesome"}}-->
Yeah only that second fix was needed to fix everything. Thank you. AwesomeAasim16:54, 27 November 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20241127165400","author":"Awesome Aasim","type":"comment","level":3,"id":"c-Awesome_Aasim-20241127165400-Sohom_Datta-20241127142300","replies":["c-Awesome_Aasim-20241130024600-Awesome_Aasim-20241127165400","c-Awesome_Aasim-20241130025000-Awesome_Aasim-20241127165400"],"displayName":"Awesome"}}-->
Actually, no. User:Sohom DattaHere is a screencast showing the problem. Cannot get the filetype correct to upload on Wikipedia, so it is on OneDrive.
Reopening the edit request one last time to get the other half of the required edit done (the first one). Thanks. AwesomeAasim02:46, 30 November 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20241130024600","author":"Awesome Aasim","type":"comment","level":4,"id":"c-Awesome_Aasim-20241130024600-Awesome_Aasim-20241127165400","replies":[],"displayName":"Awesome"}}-->
I would also add comments mentioning that the first part is for WP:USL and the second part is for user script infoboxes. AwesomeAasim02:50, 30 November 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20241130025000","author":"Awesome Aasim","type":"comment","level":4,"id":"c-Awesome_Aasim-20241130025000-Awesome_Aasim-20241127165400","replies":[],"displayName":"Awesome"}}-->
DoneSohom (talk) 03:00, 30 November 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20241130030000","author":"Sohom Datta","type":"comment","level":2,"id":"c-Sohom_Datta-20241130030000-Awesome_Aasim-20241122201500","replies":[],"displayName":"Sohom"}}-->
__DTSUBSCRIBEBUTTONDESKTOP__{"headingLevel":2,"name":"h-I_Am_Andum\u00e9-20240828173200","type":"heading","level":0,"id":"h-Interface-protected_edit_request_on_28_August_2024-20240828173200","replies":["c-I_Am_Andum\u00e9-20240828173200-Interface-protected_edit_request_on_28_August_2024"],"text":"Interface-protected edit request on 28 August 2024","linkableTitle":"Interface-protected edit request on 28 August 2024"}-->
Interface-protected edit request on 28 August 2024
__DTSUBSCRIBEBUTTONMOBILE__{"headingLevel":2,"name":"h-I_Am_Andum\u00e9-20240828173200","type":"heading","level":0,"id":"h-Interface-protected_edit_request_on_28_August_2024-20240828173200","replies":["c-I_Am_Andum\u00e9-20240828173200-Interface-protected_edit_request_on_28_August_2024"],"text":"Interface-protected edit request on 28 August 2024","linkableTitle":"Interface-protected edit request on 28 August 2024"}-->
Define background color using CSS variables, for night mode compatibility. The header background color will change slightly (from #CAE1FF to #A3D3FF), as there is no perfectly matching CSS variable.
Andumé (talk) 17:32, 28 August 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240828173200","author":"I Am Andum\u00e9","type":"comment","level":1,"id":"c-I_Am_Andum\u00e9-20240828173200-Interface-protected_edit_request_on_28_August_2024","replies":["c-Oshwah-20240911203800-I_Am_Andum\u00e9-20240828173200"],"displayName":"Andum\u00e9"}}-->
I haven't had a chance to try and test this in a sandbox or anything, but has anyone else had a chance to review this request? From the get-go, it seems to be pretty harmless... ~Oshwah~(talk)(contribs)20:38, 11 September 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240911203800","author":"Oshwah","type":"comment","level":2,"id":"c-Oshwah-20240911203800-I_Am_Andum\u00e9-20240828173200","replies":["c-Novem_Linguae-20240911205100-Oshwah-20240911203800"],"displayName":"~Oshwah~"}}-->
Agreed that this looks harmless. This might be a good one to just make the edit directly to the gadget, then quickly test it by adding &debug=1 to the URL to clear the cache. Then take a peek at #script-installer-panel on a user's JS page by clicking "Manage user scripts" and make sure things don't look too crazy. In fact now that I typed this out I think I'll just do it :) One sec. –Novem Linguae (talk) 20:51, 11 September 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240911205100","author":"Novem Linguae","type":"comment","level":3,"id":"c-Novem_Linguae-20240911205100-Oshwah-20240911203800","replies":["c-Novem_Linguae-20240911205500-Novem_Linguae-20240911205100"]}}-->
Looks good to me. Done –Novem Linguae (talk) 20:55, 11 September 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20240911205500","author":"Novem Linguae","type":"comment","level":4,"id":"c-Novem_Linguae-20240911205500-Novem_Linguae-20240911205100","replies":[]}}-->
__DTSUBSCRIBEBUTTONDESKTOP__{"headingLevel":2,"name":"h-Iniquity-20241117171800","type":"heading","level":0,"id":"h-Move_STRINGS_to_separate_JSON_file-20241117171800","replies":["c-Iniquity-20241117171800-Move_STRINGS_to_separate_JSON_file"],"text":"Move STRINGS to separate JSON file","linkableTitle":"Move STRINGS to separate JSON file"}-->
__DTSUBSCRIBEBUTTONMOBILE__{"headingLevel":2,"name":"h-Iniquity-20241117171800","type":"heading","level":0,"id":"h-Move_STRINGS_to_separate_JSON_file-20241117171800","replies":["c-Iniquity-20241117171800-Move_STRINGS_to_separate_JSON_file"],"text":"Move STRINGS to separate JSON file","linkableTitle":"Move STRINGS to separate JSON file"}-->
Hi! Can anyone please put the STRINGS in a separate JSON (for example)? This will allow loading the script directly from enwiki, and changing a separate file if localization is needed. Iniquity (talk) 17:18, 17 November 2024 (UTC)[reply]__DTELLIPSISBUTTON__{"threadItem":{"timestamp":"20241117171800","author":"Iniquity","type":"comment","level":1,"id":"c-Iniquity-20241117171800-Move_STRINGS_to_separate_JSON_file","replies":[]}}-->