Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Javascript (https://www.askmehelpdesk.com/forumdisplay.php?f=452)
-   -   How do I make a Javascript or some script to automatically log to secure website? (https://www.askmehelpdesk.com/showthread.php?t=528350)

  • Nov 22, 2010, 09:35 PM
    cozoDOP2
    How do I make a Javascript or some script to automatically log to secure website?
    An annoying website at work we use it to check uploaded files. Well, it is set up to log you off every few minutes.. so we have to keep entering the same thing . I was wondering if there was a way to login automatically using a script , whenever you go to the login page.

    I only know javascript.. do I have to learn something else?
  • Nov 22, 2010, 09:58 PM
    ITstudent2006
    http://www.computing.net/answers/pro...ipt/14250.html

    Notsure if this helps but its got useful info.
  • Nov 22, 2010, 10:44 PM
    ITstudent2006

    I have played with the script for Facebook and I've got it almost figured out. I can edit the script to auto fill my username and password but I'm still working on it submitting the login.

    That way I can put the edited script on my desktop as an html icon and clickand auto login to Facebook.

    Ill let you know if I figure it out!
  • Nov 22, 2010, 10:48 PM
    ITstudent2006
    However, I am using Chrome as my browser, when I open it with IE I get active X/script security messages. Hmm
  • Jan 22, 2011, 12:26 AM
    objectundefined
    In short, if you're using a modern browser like chrome, safari or Firefox, you would use vanilla javascript to find the form elements you care about, edit their values, and then submit the form. The function you'd use is document.querySelectorAll().

    Example:
    Code:


    document.querySelectorAll('form#login input#username')[0].value = " *YourUserName* ";
    document.querySelectorAll('form#login input#password')[0].value = " *YourPassword* ";

    document.querySelectorAll('form#login')[0].submit();

    // or document.getElementById('login').submit();

    in order to execute this safely from the URL bar, you should wrap it in a closure.

    Code:


    javascript:(function(){ ... })()


  • All times are GMT -7. The time now is 07:43 PM.