I am creating a bot in Electron.js that posts to a website. When it makes a selection, the page navigates and submits a form. I'm pretty sure it's firing a beforeunload event and asking the user for confirmation. When I tried to set
window.onbeforeunload = ()=>{}
it didn't throw an error but it still continued to ask if I was sure.
snippet of the page html,
<form id="repoststore" method="post" action="https://some-navigation.com">
<select style="width: 100%; display: none;" name="sid" id="sid" onchange="setConfirmStore()">
<option value="-1">-- Repost store item --</option>
...
</form>
Could this confirm dialog box be caused by the 'setConfirmStore()' function that appears to trigger onchange? If so, is there a way I can prevent this?
I am using electron for the application and Puppeteer for the automation.
Thank you for your time and expertise!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…