Would actively setting the attribute to "on" rather than just removing the "off" seem a sensible way of doing it after the page has loaded?
2010/1/15 Luke <[email protected]>: > No worries, it does not burst my bubble because I could careless if > someone else has done it, I am doing it for my own self knowledge. > > That being said, debugging through there code helped find the answer, > apparently you have to get your javascript to run before the content > is loaded or the password manager never knows it was changed. Which > seems rather bad in Chromes handling of these passworded forms > especially if the webpage itself switched the autocomplete option > through javascript. > > > // The password manager code checks for "autocomplete=off" in a > callback > // from WebCore when the DOM content is loaded. It doesn't seem to be > // documented, but this callback seems to happen after in-page event > listeners > // fire, and before content scripts with "run_at" = "document_end" are > loaded. > // Therefore, we load this script early and then run the actual > transform code > // on an appropriate event listener. > window.addEventListener('DOMContentLoaded', enableAutocomplete, > false); > > Thanks > Luke > > > On Jan 15, 11:37 am, Finnur Thorarinsson <[email protected]> wrote: >> Hate to burst your bubble, but it has already been >> implemented:https://chrome.google.com/extensions/detail/ecpgkdflcnofdbbkiggklcfmg... >> >> :) >> >> >> >> On Fri, Jan 15, 2010 at 10:24, Luke <[email protected]> wrote: >> > I have been trying to create an extension to allow be to override a >> > websites autocomplete="off" on there login screen. Eventually I will >> > set it up to work against any website but for now I have been trying >> > it against a simple selfcreated login form on a local webserver. The >> > problem is, that even though I can get it to remove the autocomplete >> > attribute Chrome still does not offer to save the login. >> >> > Here is the extension information: >> >> > manifest.json: >> > { >> > "name": "Remove autocomplete", >> > "version": "1.0", >> > "description": "Removes autocomplete=off from login forms", >> > "content_scripts": [ >> > { >> > "matches": ["http://intraserver.local/*"], >> > "js": ["auto_remove.js"], >> > "run_at": "document_end" >> > } >> > ] >> > } >> >> > auto_remove.js: >> > document.getElementById("password").removeAttribute("autocomplete"); >> >> > login.html: >> > <html> >> > <head> >> > <title>testform</title> >> > </head> >> > <body> >> > <form method="post" action="http://intraserver.local/test2.php"> >> > username: <input id="username" type="text"/><br/> >> > password: <input id="password" type="password" >> > autocomplete="off"/><br/> >> > <input type="submit"/> >> > </form> >> > </body> >> > </html> >> >> > As soon as I remove autocomplete="off" from the html Chrome will offer >> > to save the login info, but not when I remove it through the >> > Javascript. >> >> > Any help would be appreciated. >> >> > Thanks >> > Luke >> >> > -- >> > You received this message because you are subscribed to the Google Groups >> > "Chromium-extensions" group. >> > To post to this group, send email to [email protected]. >> > To unsubscribe from this group, send email to >> > [email protected]<chromium-extensions%2Bunsu >> > [email protected]> >> > . >> > For more options, visit this group at >> >http://groups.google.com/group/chromium-extensions?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Chromium-extensions" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/chromium-extensions?hl=en. > > > >
-- You received this message because you are subscribed to the Google Groups "Chromium-extensions" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/chromium-extensions?hl=en.
