AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Javascript for GMail Login?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
SKAN



Joined: 26 Dec 2005
Posts: 5884

PostPosted: Sat Dec 09, 2006 10:53 pm    Post subject: Javascript for GMail Login? Reply with quote

Dear Friends, Smile

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.

Rolling Eyes
_________________
SKAN - Suresh Kumar A N
Back to top
View user's profile Send private message
Titan



Joined: 11 Aug 2004
Posts: 5068
Location: imaginationland

PostPosted: Sat Dec 09, 2006 11:18 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
ScottEdge



Joined: 14 Aug 2005
Posts: 57
Location: Connecticut,USA

PostPosted: Sun Dec 10, 2006 3:51 am    Post subject: Reply with quote

Code:
javascript:with(document.forms[0]){elements[7].value="youremail@gmail.com";elements[8].value="password";void(0)}
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 5884

PostPosted: Sun Dec 10, 2006 7:53 am    Post subject: Reply with quote

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!

Smile
_________________
SKAN - Suresh Kumar A N
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 5884

PostPosted: Sun Dec 10, 2006 9:30 am    Post subject: Reply with quote

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.

Smile
_________________
SKAN - Suresh Kumar A N
Back to top
View user's profile Send private message
Titan



Joined: 11 Aug 2004
Posts: 5068
Location: imaginationland

PostPosted: Sun Dec 10, 2006 11:16 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 5884

PostPosted: Sun Dec 10, 2006 5:00 pm    Post subject: Reply with quote

Dear Titan, Smile

That is the line Very Happy .. 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, Smile
_________________
SKAN - Suresh Kumar A N
Back to top
View user's profile Send private message
menon
Guest





PostPosted: Mon Jan 01, 2007 11:31 am    Post subject: javascript for gmail login? Reply with quote

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

PostPosted: Mon Jan 01, 2007 12:06 pm    Post subject: Reply with quote

Hi menon Smile

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, Smile

PS: Kerala ?
_________________
SKAN - Suresh Kumar A N
Back to top
View user's profile Send private message
menon
Guest





PostPosted: Mon Jan 01, 2007 12:27 pm    Post subject: javascript for gmail login? Reply with quote

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.. Very Happy

PS. can I have ur yahoo id?
Back to top
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Mon Jan 01, 2007 12:44 pm    Post subject: Re: javascript for gmail login? Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group