Is there any event that is generated when the address bar text is changed by the user? For example, when a user tries to execute javascript through the address bar.
I checked all the window events, none of them apply to the address bar.
Update
According to the comments, I tried window.onhashchange , but it only starts if the hash changes, and not for the actual URL.
The reason I need this to find a way to stop the user from executing javascript from the address bar. Thus, the timer solution will not work.
Is there any way to catch onbeforeunload and return the location back to the previous one?
source share