MediaWiki talk:Gadget-confirmationRollback-mobile.js
Appearance
Oct 2020 - broken?
Reported as not working in Wikipedia:Village_pump_(technical)/Archive_184#Gadget:_"Require_confirmation_before_performing_rollback_on_mobile_devices". @MusikAnimal: would you take a look at this please? — xaosflux Talk 16:54, 16 October 2020 (UTC)
- @Xaosflux and MusikAnimal: Been playing around with this. I think the issue is how the gadget is loaded, or the script, or something. The actual script (MediaWiki:Gadget-confirmationRollback-mobile.js, minus the useragent part anyway) works fine when the event is added manually (the $(".mw-rollback-link").on part) using the developer console (that exact code). So I think the issue lies in how the stuff is being registered - that seems to be failing. I have minimal experience with MediaWiki and gadgets/userscripts, so no clue what's wrong, but just FYI. BTW, the user agent part, can't this be scrapped and just work regardless on the Minerva skin? (or perhaps the targets or skins options may be relevant?) ProcrastinatingReader (talk) 17:17, 16 October 2020 (UTC)
- Just for reference, this is invoked by default using:
confirmationRollback-mobile[ResourceLoader|default|rights=rollback|dependencies=mediawiki.util]|confirmationRollback-mobile.js
. — xaosflux Talk 18:10, 16 October 2020 (UTC)- Xaosflux, note that this code fixes the bug, works on Minerva (at least on en.m. in Chrome, haven't tried on my actual phone) with it: User:ProcrastinatingReader/sandbox.js, when I swap the code of this to the gadget code (Special:Diff/983871059) it breaks. Maybe replace code with the sandbox? The useragent check part that I've commented out may well be fine (haven't tested), but maybe it's better to replace it in favour of a target mobile, or skin Minerva check (of ResourceLoader)? ProcrastinatingReader (talk) 19:07, 16 October 2020 (UTC)
- @ProcrastinatingReader: Back when this was first created, the "advanced mode" of Mobile Frontend did not exist yet, so it was actually built for mobile users viewing desktop skins. This is why it checks user agents, and it will still need to in order to support that use case. I believe we just need to add mobile as a target to the RL config. I'm currently testing this out on testwiki and will update the gadget here when I get it working. Also I don't recall getting your ping on VPT from last month, sorry that I missed it. — MusikAnimal talk 02:01, 17 October 2020 (UTC)
- @ProcrastinatingReader and Xaosflux: I think Special:Diff/983922297 fixed it. Please confirm. — MusikAnimal talk 02:18, 17 October 2020 (UTC)
I believe we just need to add mobile as a target to the RL config.
heh, obligatoryI have minimal experience with MediaWiki and gadgets/userscripts, so no clue what's wrong, but just FYI
above ended up being handy (assuming that fixes it; it probably will). Thanks for looking into it! ProcrastinatingReader (talk) 02:19, 17 October 2020 (UTC)- MusikAnimal yes, works now. Thanks again! ProcrastinatingReader (talk) 02:21, 17 October 2020 (UTC)
- @ProcrastinatingReader: Back when this was first created, the "advanced mode" of Mobile Frontend did not exist yet, so it was actually built for mobile users viewing desktop skins. This is why it checks user agents, and it will still need to in order to support that use case. I believe we just need to add mobile as a target to the RL config. I'm currently testing this out on testwiki and will update the gadget here when I get it working. Also I don't recall getting your ping on VPT from last month, sorry that I missed it. — MusikAnimal talk 02:01, 17 October 2020 (UTC)
- Xaosflux, note that this code fixes the bug, works on Minerva (at least on en.m. in Chrome, haven't tried on my actual phone) with it: User:ProcrastinatingReader/sandbox.js, when I swap the code of this to the gadget code (Special:Diff/983871059) it breaks. Maybe replace code with the sandbox? The useragent check part that I've commented out may well be fine (haven't tested), but maybe it's better to replace it in favour of a target mobile, or skin Minerva check (of ResourceLoader)? ProcrastinatingReader (talk) 19:07, 16 October 2020 (UTC)
- Just for reference, this is invoked by default using: