Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Code that automatically go to login page and click login:

javascript: window.location = 'https://1.1.1.1/login.HTML';
while (true) {
    if (document.readyState == "complete") {
        window.onload(document.forms[0].Submit.click());
        break;
    }
}

Code passed through jsbeautifier; original does not have line breaks

I paste this script on urlbar but its not working (it go to https://1.1.1.1/login.HTML but not login) but if I'm on https://1.1.1.1/login.HTML and paste this script it works. I don't understand why it does not work.

share|improve this question
    
It might look if it comes from another page. – Alex Jul 9 '11 at 18:02
    
On which browser are you doing this? while (true) is effectively an infinite loop and should lock up the browser – Yi Jiang Jul 9 '11 at 18:19
    
@Yi Jiang im use firefox and remember id, pass for login – fronthem Jul 9 '11 at 18:37

javascript: URLs are run in the context of the current page.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .