MediaWiki talk:Gadget-confirmationRollback-mobile.js

Oct 2020 - broken?

[edit]

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)[reply]

@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)[reply]
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)[reply]
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)[reply]
@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)[reply]
@ProcrastinatingReader and Xaosflux: I think Special:Diff/983922297 fixed it. Please confirm. MusikAnimal talk 02:18, 17 October 2020 (UTC)[reply]
I believe we just need to add mobile as a target to the RL config. heh, obligatory I 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)[reply]
MusikAnimal yes, works now. Thanks again! ProcrastinatingReader (talk) 02:21, 17 October 2020 (UTC)[reply]
[edit]

Hi - I have come here to report that as of today, I noticed that the "cancel" and "OK" buttons on the popup operate in exactly the same way; in other words, it does not matter if you hit "cancel", the rollback is still carried out. I am on iPhone and use the desktop version of the site. The popup does not show up at all on the mobile site; the action is carried out instantly. Patient Zerotalk 00:06, 24 August 2025 (UTC)[reply]

Pinging MusikAnimal, Xaosflux and ProcrastinatingReader -- Patient Zerotalk 00:07, 24 August 2025 (UTC)[reply]
I'm not sure what the fix for this is, but can you clarify your bug report? Are you getting the popup, and it is not working for cancel; or are you not getting the popup at all? — xaosflux Talk 00:36, 24 August 2025 (UTC)[reply]
On the desktop version (whilst using the iPhone to browse), the former; on the mobile version, the latter. Patient Zerotalk 01:09, 24 August 2025 (UTC)[reply]
Which browser and which version? MusikAnimal talk 17:36, 25 August 2025 (UTC)[reply]
Hi MusikAnimal - long time no see! Safari version 18.6. Patient Zerotalk 22:41, 27 August 2025 (UTC)[reply]
Hi! Hope you are well :)
I seem to recall Safari bugs being reported before. I unfortunately have no reasonable means to debug it as I do not have an iPhone or an Apple device. We may need to consult an interested developer who does own one. MusikAnimal talk 02:45, 28 August 2025 (UTC)[reply]