0

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.

animuson
  • 53,861
  • 28
  • 137
  • 147
cweston
  • 11,297
  • 19
  • 82
  • 107
  • 2
    window.onbeforeunload = prompt("Where are you going?", "Please tell us where you are going."); :) – JYelton Apr 22 '10 at 15:19

3 Answers3

4

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?

Matt
  • 74,352
  • 26
  • 153
  • 180
3

No, what if they loaded www.mybankwithterriblesecurity.com/?password=password ?

Alex K.
  • 171,639
  • 30
  • 264
  • 288
1

No, that would be a gigantic security problem.

The traditional SO long answer would be "nooooooooooooooooooooooooooooooo".

Pointy
  • 405,095
  • 59
  • 585
  • 614