Does anyone know how to (or if it is possible) to get the address bar value after a user tries to navigate to another page from my site?
To be clear, I'm not looking for the value stored in window.location (since this is the page that the user will currently be on), but rather the site that the user is trying to navigate to.
-
2window.onbeforeunload = prompt("Where are you going?", "Please tell us where you are going."); :)JYelton– JYelton2010年04月22日 15:19:03 +00:00Commented Apr 22, 2010 at 15:19
3 Answers 3
This isn't possible.
You can of course capture the target URL of a link if the user changes page via hyperlinks in your page, but as far as typing a new URL in the address bar, no. Why, anyway?
Comments
No, what if they loaded www.mybankwithterriblesecurity.com/?password=password ?
Comments
No, that would be a gigantic security problem.
The traditional SO long answer would be "nooooooooooooooooooooooooooooooo".