Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 –  1eftHer0 Jul 9 '11 at 18:37

1 Answer 1

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.