Why does setting autocomplete="on" via a user script still not allow storing of passwords in Chrome? -


my goal use greasemonkey-style user script in google chrome enable remembering of passwords on specific form has autocomplete="off" attribute set.

chrome's developer tools indicate autocomplete="on" being set script, not have expected effect of allowing storage of passwords on form.

why doesn't work?


example

chrome offers remember passwords entered on test page (expected):

<html><body><form action="">     <input type="text" name="username" />     <input type="password" name="password" />     <input type="submit" name="submit" value="log in" /> </form></body></html> 

chrome not offer remember passwords entered on test page (expected):

<html><body><form action="">     <input type="text" name="username" />     <input type="password" name="password" autocomplete="off" />     <input type="submit" name="submit" value="log in" /> </form></body></html> 

chrome's inspect element tool reveals successful modification of above test page user script (expected):

<html><head></head><body><form action="" autocomplete="on">     <input type="text" name="username" autocomplete="on">     <input type="password" name="password" autocomplete="on">     <input type="submit" name="submit" value="log in"> </form></body></html> 

chrome still not offer remember passwords after modification (unexpected).

as experiment, try bookmarklet, clears autocompletes , pops dialog (typical): results dialog bookmarklet

javascript:(function%20(){var%20zcurrentelement=document.activeelement;var%20cfa,cea,cs,df,fe,i,j,sf,se;cfa=cea=cs=0;df=document.forms;for(i=0;i<df.length;i++){sf=df[i];fe=sf.elements;if(sf.onsubmit){sf.onsubmit='';cs++;}if(sf.attributes.autocomplete){sf.attributes.autocomplete.value='on';++cfa;}for(j=0;j<fe.length;j++){se=fe[j];if(se.attributes.autocomplete){se.attributes.autocomplete.value='on';cea++;}}}var%20znode=document.createelement('div');znode.setattribute('id','idapw_notifwindow');znode.innerhtml='<p>removed:</p>'+'<ul>'+'<li>"autocomplete=off"%20from%20'+cfa+'%20form(s)<br>'+'%20and%20from%20'+cea+'%20form%20element(s).'+'<li>onsubmit%20from%20'+cs+'%20form(s).'+'</ul>'+'<p>after%20you%20type%20your%20password%20and%20submit%20the%20form,%20the%20browser%20will%20offer%20to%20remember%20your%20password.</p>'+'<style%20type="text/css">'+'#idapw_notifwindow'+'{'+'position:%20%20%20absolute;'+'visibility:%20visible;'+'margin:%205px;'+'padding:0em%202em%202em%202em;'+'max-width:%20%20400px;'+'background-color:%20%20%20orange;'+'border:%203px%20double;'+'font-size:%20%2014px;'+'text-align:%20left;'+'opacity:0.97;'+'z-index:1000;'+'cursor:%20pointer;'+'}'+''+'#idapw_notifwindow%20p,%20#idapw_notifwindow%20ul,%20#idapw_notifwindow%20li'+'{'+'margin:%200;'+'padding:%200;'+'line-height:130%;'+'}'+'#idapw_notifwindow%20p'+'{'+'padding:1em%200%200%200'+'}'+'#idapw_notifwindow%20ul'+'{'+'padding:0%200%200%202em;'+'}'+'#idapw_notifwindow%20li'+'{'+'margin:%200%200%200.5em%200;'+'}'+'</style>';znode.style.top=window.scrolly+'px';znode.style.left=window.scrollx+'px';document.body.appendchild(znode);znode.addeventlistener("click",function(){var%20znode=document.getelementbyid('idapw_notifwindow');if(znode)znode.style.visibility='hidden';},false);if(zcurrentelement){if(/input/i.test(zcurrentelement.tagname)){zcurrentelement.blur();zcurrentelement.focus();}}})(); 


if works, gm script may missing form-level autocomplete="off" or there may onsubmit handler somewhere in page.

if doesn't work, task may not possible in chrome. (note similar gm , bookmarklet both work fine in firefox. :) )


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -