How to unbind the window.onbeforeunload when Inactivity timeout?

We are applying dirty form tracking in our application. If there is any screen being edited and record remain unsaved. Leave the application idle until inactivity timeout, a confirmation message prompted when redirecting back to login page. it makes the application being blocked from the page redirection by the confirmation message box.

My question, how we can unbind the window.onbeforeunload when F5 inactivity timing out?

Please advice.

Could I call a javascript function after inactivity timeout?

To accomplish this, you would need to do some custom javascript injection. Here’s a codeshare post about how to do javascript injection.

You’ll want to be careful though, as the onbeforeunload event may not behave exactly the same across all browsers.