cba icon indicating copy to clipboard operation
cba copied to clipboard

Automate JavaScript confirmation dialog acceptance

Open esteban-filardi opened this issue 2 years ago • 2 comments

Is there any way to automate the acceptance of a confirm dialog that was created with JavaScript ?

I mean, dialogs created in this fashion:

window.confirm('Do you accept?');

image

esteban-filardi avatar May 09 '22 00:05 esteban-filardi

I was able to make the automation work by overriding the windows.confirm method to return true using an inject action.

esteban-filardi avatar May 09 '22 00:05 esteban-filardi

I was able to make the automation work by overriding the windows.confirm method to return true using an inject action

This is smart!

Unfortunately there is no reliable way of clicking the native "OK" button as of my knowledge, but yeah, having confirmation trick in Functions may be a good idea. Love this trick ❤️

Manvel avatar Dec 25 '23 10:12 Manvel