Auto Login a website when the browser is opened;

3,128 views
Skip to first unread message

Aswin Kumar K P

unread,
Dec 9, 2013, 10:02:19 AM12/9/13
to chromium-...@chromium.org
I need my browser to login to a website automatically when my browser is opened.I have completed all others in my extension.But I cant figure out how can I do this. Please Help Me....

Mihai Coman

unread,
Dec 9, 2013, 10:21:08 AM12/9/13
to chromium-...@chromium.org
"I have completed all others in my extension." - all others...what?
Are you trying to write an extension that would log you in automatically? Do you expect Chrome to do that for you?

Aswin Kumar K P

unread,
Dec 9, 2013, 12:24:25 PM12/9/13
to chromium-...@chromium.org
Yeah you're right .I want my extension to log me in automaticaly into a site. Was it possible?? How can I do that???

PhistucK

unread,
Dec 9, 2013, 12:29:32 PM12/9/13
to Aswin Kumar K P, Chromium-extensions
If you are talking about a specific website, you should use a content script with match patterns for that specific website.
Most of the times, simple things work. You find the relevant fields (username, password), change their value and trigger a click on a submit button (for example, submitButton.click()), or submit the form (for example, form.submit()).
Some websites have irregular login scripts that require fake input events (keydown, keyup or keypress) and fake focus events to be triggered on the fields. You will have to experiment to find out.


PhistucK


--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/0ce0bc75-ce24-4221-a536-d4dec4c92a5e%40chromium.org.

Aswin Kumar K P

unread,
Dec 11, 2013, 9:15:22 AM12/11/13
to chromium-...@chromium.org
<div class="fer">
     <label for="ft_un">
        Username(Net ID):
     </label>
    <input id="ft_un" style="width:245px" name="username"></input>
 </div>
<div class="fer">
    <label for="ft_pd">
        Net ID Password:
    </label>
    <input id="ft_pd" type="password" style="width:245px" name="password"></input>
</div>
<div class="fer">
    <input type="submit" value="Continue"></input>

This is the form's HTML for username and password fields on a site.How can I use content script and match pattern to fill those information on a site and trigger the submit button,So that my extension will auto login to a site.

PhistucK

unread,
Dec 11, 2013, 11:03:27 AM12/11/13
to Aswin Kumar K P, Chromium-extensions
A content script can access the DOM.
Think about it like a script that you simply add to the page. How would you enter the credentials and submit the form in a normal script? that is exactly how you would do it in a content script.
The definition of the content script within the manifest is as follows -
"content_scripts": [{"js": "content-script-name.js", "matches": "http://the-given-website.com/the/give/path?or=query&string=1", "run_at": "document_end"}]



PhistucK


--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
Reply all
Reply to author
Forward
0 new messages