Stop LastPass filling out a form

前端 未结 13 1705
遇见更好的自我
遇见更好的自我 2020-12-07 13:38

Is there a way to prevent the LastPass browser extension from filling out a HTML-based form with a input field with the name \"username\"?

This is an hidden field,

相关标签:
13条回答
  • 2020-12-07 14:13

    Bit late to the party but I have just achieved this with modifying the form with:

    <form autocomplete="off" name="lastpass-disable-search">
    

    I guess this fools lastpass into thinking that it's a search form. This does not work for password fields however! Lastpass ignores the name field in this case.

    The only way I've managed to do this is to add the following directly at the top of the form:

    <form autocomplete="off">
        <div id="lp" ><input type="text" /><input type="password" /></div><script type="text/javascript">setTimeout(function(){document.getElementById('lp').style.display = 'none'},75);</script>
    </form>
    

    It causes a nasty flicker but does remove the autofill nonsense - though it does still show the "generate password" widget. LastPass waits until domready and then checks to see if there are any visible password fields, so it's not possible to hide or shrink the mock fields above.

    0 讨论(0)
提交回复
热议问题