To help centralise discussions and keep related topics together, Wikipedia talk:User scripts/List and Wikipedia talk:User scripts/Ranking redirect here. |
This project page does not require a rating on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||
|
This page has archives. Sections older than 90 days may be automatically archived by Lowercase sigmabot III when more than 4 sections are present. |
See here for a complete list of archives and other subpages from the deprecated WikiProject User scripts. |
I have many user scripts installed in my common.js page, which seem to be clashing with each other. At the top of every page, some of the disrupting elements seem to be parts of RedWarn, but they are still appearing again and again even though I have uninstalled RedWarn from my common.js.
I don't know what's causing
Volker E. (WMF)'s
dark-mode.js to dysfunction. For some reason, the dark mode's toggle button appears 4 times on the top of every page, and one of the button says "light mode", while the rest say "dark mode".
Also, in desktop mode, the source editor initially does not show any article content, instead just displays "the below text may contain spoilers" with a [show] button at the right side.
What could have caused RedWarn's parts to appear again?
Can anyone help me to fix the dark mode at least? Other clashing scripts are more annoying, but I really need dark mode for visual contrast. — CrafterNova [ TALK ] [ CONT ] 12:56, 22 January 2024 (UTC)
importScript
, the other mw.loader.load
) and then forking the script on top of that. I suggest you remove all that (lines 65–89), and enable the dark mode toggle gadget in Preferences if you haven't done so.
Nardog (
talk) 13:08, 22 January 2024 (UTC)
A userscript can automatically generate and publish an edit using mw.Api.postWithEditToken(...). This is possible to do from any Wikipedia page to any remote Wikipedia page.
Portlet links which use WP:TemplateScript allow to generate and preview an edit for a page, currently opened in the wikitext editor.
Is there any way for a userscript to show a preview for an automatic edit for a remote page? My particular use case is generating an edit to another user's talk page from their contributions page. That is, a portlet link on a page like Special:Contributions/Example should load a preview with an edit of User talk:Example. — andrybak ( talk) 15:40, 10 February 2024 (UTC)
$('<form>').attr({
method: 'post',
action: mw.util.getUrl('Wikipedia:Sandbox', { action: 'edit' }),
enctype: 'multipart/form-data'
}).append(
$('<input>').attr({
name: 'wpTextbox1',
type: 'hidden'
}).val('foo')
).appendTo(document.body).trigger('submit').remove();
There doesn't seem to be a way to suppress the preview.– here are tweaked fields of the form to mimic "Show changes" instead of "Show preview":
/* the data of the edit */
$('<input>').attr({
name: 'wpTextbox1',
type: 'hidden'
}).val(newWikitext),
$('<input>').attr({
name: 'wpSummary',
type: 'hidden'
}).val(editSummary),
/* show as a diff */
$('<input>').attr({
name: 'wpDiff',
type: 'hidden'
}).val(true),
/* wpUltimateParam is needed to avoid the scary error
* "Some parts of the edit form did not reach the server" */
$('<input>').attr({
name: 'wpUltimateParam',
type: 'hidden'
}).val(1)
@ Nardog I mean, that's what User:BrandonXLF/GreenRedirects is. I don't see why it'd be a worse idea than JS, which can actually compromise one's browser. Aaron Liu ( talk) 02:54, 21 February 2024 (UTC)
@import
doesn't, but can delay first paint.
Nardog (
talk) 06:12, 21 February 2024 (UTC)
Hey, do we have a script which can highlight your own username in a page? I remember seeing something similar a while ago but can't find that now. Can sormeone link it please? Thanks. — The Herald (Benison) ( talk) 05:35, 25 February 2024 (UTC)
ahref$="User:The_Herald" { background-color:#FFFF00; }
To help centralise discussions and keep related topics together, Wikipedia talk:User scripts/List and Wikipedia talk:User scripts/Ranking redirect here. |
This project page does not require a rating on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||
|
This page has archives. Sections older than 90 days may be automatically archived by Lowercase sigmabot III when more than 4 sections are present. |
See here for a complete list of archives and other subpages from the deprecated WikiProject User scripts. |
I have many user scripts installed in my common.js page, which seem to be clashing with each other. At the top of every page, some of the disrupting elements seem to be parts of RedWarn, but they are still appearing again and again even though I have uninstalled RedWarn from my common.js.
I don't know what's causing
Volker E. (WMF)'s
dark-mode.js to dysfunction. For some reason, the dark mode's toggle button appears 4 times on the top of every page, and one of the button says "light mode", while the rest say "dark mode".
Also, in desktop mode, the source editor initially does not show any article content, instead just displays "the below text may contain spoilers" with a [show] button at the right side.
What could have caused RedWarn's parts to appear again?
Can anyone help me to fix the dark mode at least? Other clashing scripts are more annoying, but I really need dark mode for visual contrast. — CrafterNova [ TALK ] [ CONT ] 12:56, 22 January 2024 (UTC)
importScript
, the other mw.loader.load
) and then forking the script on top of that. I suggest you remove all that (lines 65–89), and enable the dark mode toggle gadget in Preferences if you haven't done so.
Nardog (
talk) 13:08, 22 January 2024 (UTC)
A userscript can automatically generate and publish an edit using mw.Api.postWithEditToken(...). This is possible to do from any Wikipedia page to any remote Wikipedia page.
Portlet links which use WP:TemplateScript allow to generate and preview an edit for a page, currently opened in the wikitext editor.
Is there any way for a userscript to show a preview for an automatic edit for a remote page? My particular use case is generating an edit to another user's talk page from their contributions page. That is, a portlet link on a page like Special:Contributions/Example should load a preview with an edit of User talk:Example. — andrybak ( talk) 15:40, 10 February 2024 (UTC)
$('<form>').attr({
method: 'post',
action: mw.util.getUrl('Wikipedia:Sandbox', { action: 'edit' }),
enctype: 'multipart/form-data'
}).append(
$('<input>').attr({
name: 'wpTextbox1',
type: 'hidden'
}).val('foo')
).appendTo(document.body).trigger('submit').remove();
There doesn't seem to be a way to suppress the preview.– here are tweaked fields of the form to mimic "Show changes" instead of "Show preview":
/* the data of the edit */
$('<input>').attr({
name: 'wpTextbox1',
type: 'hidden'
}).val(newWikitext),
$('<input>').attr({
name: 'wpSummary',
type: 'hidden'
}).val(editSummary),
/* show as a diff */
$('<input>').attr({
name: 'wpDiff',
type: 'hidden'
}).val(true),
/* wpUltimateParam is needed to avoid the scary error
* "Some parts of the edit form did not reach the server" */
$('<input>').attr({
name: 'wpUltimateParam',
type: 'hidden'
}).val(1)
@ Nardog I mean, that's what User:BrandonXLF/GreenRedirects is. I don't see why it'd be a worse idea than JS, which can actually compromise one's browser. Aaron Liu ( talk) 02:54, 21 February 2024 (UTC)
@import
doesn't, but can delay first paint.
Nardog (
talk) 06:12, 21 February 2024 (UTC)
Hey, do we have a script which can highlight your own username in a page? I remember seeing something similar a while ago but can't find that now. Can sormeone link it please? Thanks. — The Herald (Benison) ( talk) 05:35, 25 February 2024 (UTC)
ahref$="User:The_Herald" { background-color:#FFFF00; }