Ask coding questions

← Back to all posts
how do i get the url of the website that is being unloaded to in onbeforeunload event

I'm making a sort of proxy thing and I'm having an issue that whenever I use google, and type a new search from google, it actually changes the (I'm assuming), so, my question is, how do I (because I want to make sure this doesn't happen) set iframe.contentWindow.onbeforeunload and get the url that the website wants to unload to, so i can block it from going to my website.

(I'm using an iframe)