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
54.9k28 gold badges142 silver badges150 bronze badges
asked Apr 22, 2010 at 15:13
1
  • 2
    window.onbeforeunload = prompt("Where are you going?", "Please tell us where you are going."); :) Commented Apr 22, 2010 at 15:19

3 Answers 3

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?

answered Apr 22, 2010 at 15:15
Sign up to request clarification or add additional context in comments.

Comments

3

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

answered Apr 22, 2010 at 15:16

Comments

1

No, that would be a gigantic security problem.

The traditional SO long answer would be "nooooooooooooooooooooooooooooooo".

answered Apr 22, 2010 at 15:16

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.