1

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.

Yi Jiang
  • 257
fronthem
  • 173
  • 6

1 Answers1

4

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

Hello71
  • 8,517
  • 5
  • 40
  • 45