javascript - Autoclick on a button in popped up dialog box -
how auto-click on yes or no button on dialog box pops on website?
one crude way i'm using set timer trigger click on button if dialog box visible once every 100ms.
check following options:
- for native
confirm()
oralert()
methods, cannot click programatically on buttons dismiss. can closed on user interaction. - for html based dialog box (bootstrap modal example), initiate mutation observer listener debounce of 50ms (debouncing allow reduce evaluation calls on bunch of elements added). when modal elements inserted dom, trigger
click
event on necessary button mutation observer handler.
Comments
Post a Comment