javascripthtmlgoogle-chromeautocompletelastpass

Why is autocomplete=off being supposedly added by my LastPass browser extension for this one page at least, and how can I prevent it from doing so?


Problem Background & Steps

I am using Chrome 58 on a Mac OS version 10.12.3.

Something like this is happening: StackOverflow - What is _lpchecked=“1” for in a form?

This attribute is added to the parent form element when I click inside of a child input element.

My problem is that when this happens, the attribute "autocomplete=off" is added to the input element. When switching between child input elements, this attribute is added to the currently focused element.

The element names are "to_email" and "comments".

This is not a login form, but a sharing form.

This seems to happen based on me having the LastPass extension, the name of the variable, and a bit of online searching.

I have tried going into the LastPass Account Settings area, "Never URLs" section/tab, and adding the URL to the "Never Do Anything" category.

The URL is of the form sub.domain.tld/path/resource.php?queryParam=value. LastPass would only allow me to add the URL without the query portion to the list, even when I tried a wildcard asterisk (*) for the value.

Even after accessing the LastPass Extension Menu > More Options > Advanced > Refresh Sites, Clear Local Cache, and refreshing the page, this problem still occurs.

I did not see any information in the Hacker News article about a similar signon.overrideAutocomplete property in Chrome like Firefox has, and may not want such a broad solution anyway.

I don't want to have to install another extension like autocomplete-on (seems to not exist) and have functions 'battle' each other, which may not even produce desirable results, like working at all, or flipping constantly.

I have even searched for what else might be doing this with words such as "adding attribute" and "dynamic", but Google biases the results to less complex scenarios about specific pages, something I could try to solve with TamperMonkey if I wanted to.

If there was any such problem like 'sniffing' for more autocomplete information, as somewhat mentioned by these links:

Then hopefully it should be fine if I only fix this problem on a limited basis, especially only for forms with insensitive data.

Questions

Funny Link


Solution

  • For now it seems to work if I add a TamperMonkey script to overwrite the value.

    This is not as large a solution as the jonmetz fellow mentioned making his own plugin (his is in Firefox), and can be duplicated as needed. If this is needed a lot, then maybe an extension would be more convenient.

    Because of the dynamic and repeated nature of the issue on the page, a simple assignment did not work, and was overwritten.

    My preference for the attribute remains as the end result if I add an onFocus Event Listener thusly:

    var emailInput = document.querySelector('input[name="to_email"]');
    emailInput.addEventListener('focus', function(){
      this.autocomplete = "on";
    });
    

    I also do this in case it helps at all:

    var parentForm = emailInput.parentNode;
    parentForm.setAttribute('_lpchecked', '1');