Is there any event
which is generated when the address bar text is modified by the user? Like, when user tries to execute javascript through address bar.
I have checked all the window
events, none of them relate to address bar.
Update
As per the comments, I have tried window.onhashchange
, but it only fires if the hash changes, not for the actual URL.
The reason I need this to find a way to stop the user from executing javascript from address bar. So, the timer solution won't work either.
Is there any way I can catch the onbeforeunload
and set the location back to the previous one?