| View previous topic :: View next topic |
| Author |
Message |
SKAN
Joined: 26 Dec 2005 Posts: 5884
|
Posted: Sat Dec 09, 2006 10:53 pm Post subject: Javascript for GMail Login? |
|
|
Dear Friends,
Right now I am writing a HTML file with my username and password to auto-login into my GMail account.
Question: Is it possible to auto fill the login form @ http://mail.google.com by sending some javascript to the address bar?.
Please help.
 _________________ SKAN - Suresh Kumar A N |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5068 Location: imaginationland
|
Posted: Sat Dec 09, 2006 11:18 pm Post subject: |
|
|
| Code: | javascript:void(document.getElementById("gaia_loginform").Email.value = 'username');
javascript:void(document.getElementById("gaia_loginform").Passwd.value = 'pass'); |
_________________
RegExReplace("irc.freenode.net/ahk", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2") |
|
| Back to top |
|
 |
ScottEdge
Joined: 14 Aug 2005 Posts: 57 Location: Connecticut,USA
|
Posted: Sun Dec 10, 2006 3:51 am Post subject: |
|
|
| Code: | | javascript:with(document.forms[0]){elements[7].value="youremail@gmail.com";elements[8].value="password";void(0)} |
|
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5884
|
Posted: Sun Dec 10, 2006 7:53 am Post subject: |
|
|
| Titan wrote: | | Code: | javascript:void(document.getElementById("gaia_loginform").Email.value = 'username');
javascript:void(document.getElementById("gaia_loginform").Passwd.value = 'pass'); |
|
Many thanks Titan! Works perfectly ..
| Code: | | javascript:with(document.forms[0]){elements[7].value="youremail@gmail.com";elements[8].value="password";void(0)} |
Many thanks SCottEdge! However, I had to change elements[7] and elements[8] to elements[6] and elements[7].
Why is it so? I use IE 6 in WIN2K SP4. Does the Javascript values (?) change with Browsers?
.. and sorry, one more question! How to submit that form ?
Please help!
 _________________ SKAN - Suresh Kumar A N |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5884
|
Posted: Sun Dec 10, 2006 9:30 am Post subject: |
|
|
With google search, I found this line which seems to work: javascript:document.forms[0].submit()
Can I do the login with a single line Javascript?
Please help.
 _________________ SKAN - Suresh Kumar A N |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5068 Location: imaginationland
|
Posted: Sun Dec 10, 2006 11:16 am Post subject: |
|
|
| Goyyah wrote: | | Can I do the login with a single line Javascript? |
| Code: | | javascript:var f = document.getElementById("gaia_loginform");void(f.Email.value = 'user');void(f.Passwd.value = 'testpass');f.submit(); |
_________________
RegExReplace("irc.freenode.net/ahk", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2") |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5884
|
Posted: Sun Dec 10, 2006 5:00 pm Post subject: |
|
|
Dear Titan,
That is the line .. though I do not understand much from it!
( I should begin to learn Javascript soon )
I have a working script now.
Thanks a lot .. Regards,  _________________ SKAN - Suresh Kumar A N |
|
| Back to top |
|
 |
menon Guest
|
Posted: Mon Jan 01, 2007 11:31 am Post subject: javascript for gmail login? |
|
|
| hi..where do I put this code?is it possible to put some javascript in some page so that one could automatically login into say gmail on the click of a button |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5884
|
Posted: Mon Jan 01, 2007 12:06 pm Post subject: |
|
|
Hi menon
The code should look something like this:
| Code: | username := "ahkuser"
password := "ahkuser1"
JS =
( join ltrim
javascript:with(document.forms[0]){elements[6].value="%username%";elements
[7].value="%password%";void(0)}
)
Run, %A_ProgramFiles%\Internet Explorer\iexplore.exe http://mail.google.com, MAX, PID
Winwait, Welcome to Gmail
MsgBox, 0, Wait for 7 Seconds, Click OK after the page is loaded, 7 ; 7 seconds
ControlSetText, Edit1, %JS%, A
ControlSend, Edit1, {Enter}, A
Send, {Tab 3}{Enter} |
BTW, that is a valid id. Take care and please do not abuse.
Regards,
PS: Kerala ? _________________ SKAN - Suresh Kumar A N |
|
| Back to top |
|
 |
menon Guest
|
Posted: Mon Jan 01, 2007 12:27 pm Post subject: javascript for gmail login? |
|
|
hi skan,
thanks for ur prompt response.the problem I face is I have done the auto login with autohotkey script and I tot of implementing the same without using the autohotkey script..i e to go to a page n enter details automatically from a button click from another page using javascript..btw im not a pro in javascript..
PS. can I have ur yahoo id? |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Mon Jan 01, 2007 12:44 pm Post subject: Re: javascript for gmail login? |
|
|
| menon wrote: | | to go to a page n enter details automatically from a button click from another page using javascript.. | AFAIK, it cannot be done, at least for security reasons...
I can be wrong, perhaps using frames or such... but I guess modern browsers don't like cross-site scripting. _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
|