how do i ensure its only the continue button for the timeout thingy and not for continue…
- User
how do i ensure its only the continue button for the timeout thingy and not for continue with some other process
- Assistant
To make sure you only ever click the “Continuar” that belongs to the timeout-popup (and not any other “Continuar” on the page), you just need to narrow your selector (or add a runtime check) so it matches:
• The name/value combo you already have
• …plus the uniqueonclick="parent.Swal.close();”attribute
• (Optionally) that it lives inside the Swal modal containerHere’s how to tweak your Tampermonkey script to be laser-precise:
// ==UserScript== // @name Auto-Timeout “Continuar” Only // @namespace http://tampermonkey.net/ // @version 0.2 // @description Only clicks the Swal timeout “Continuar” button // @match *://your-aspx-site.com/* // ← update this! // @grant none // ==/UserScript== (function(){ 'use strict'; // 1) Match name/value AND onclick containing “Swal.close” // 2) Optionally, ensure it’s inside a Swal2 container (class usually "swal2-container") const selector = ` .swal2-container input [name="ctl11"] [value="Continuar"] [onclick*="Swal.close"] `.trim().replace(/\s+/g,''); const CLICK_INTERVAL = 60*1000; // 1 minute function clickTimeoutContinue(){ const btn = document.querySelector(selector); if(btn && btn.offsetParent !== null){ console.log('[Auto-Click]', btn); btn.click(); } } setInterval(clickTimeoutContinue, CLICK_INTERVAL); })();Explanation:
-
.swal2-container input[...]
Targets only inputs inside SweetAlert2 popups. If your modal uses a different wrapper class or ID replace.swal2-containerwith whatever you see in DevTools. -
[onclick*="Swal.close"]
Grabs only the button whoseonclickhandler invokesSwal.close(). No other “Continuar” on your page will have that. -
offsetParent !== null
Makes sure it’s visible before clicking.
————
Bookmarklet version (one-off click when popup appears):
javascript:(function(){ var sel = '.swal2-container input' +'[name="ctl11"]' +'[value="Continuar"]' +'[onclick*="Swal.close"]', b = document.querySelector(sel); if(b && b.offsetParent!==null) b.click(); else alert('Timeout button not found!'); })();Save that as a bookmark. When the popup shows, click it and only the timeout “Continuar” will fire.
—
With either approach you’re safe from mis-clicking any other “Continuar” on the page. Let me know if your popup wrapper has a different class or if you need help adapting! -
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.