title: At what point does Chrome disable autocomplete on form elements? (Research for Chrome extension)
body: <p>I'm writing a Chrome extension that may collect information from form elements (text boxes) on a page. Having said that I want to prevent my extension from collecting user sensitive information.</p>
  
  <p>My first guess is to avoid password fields, which is easy.</p>
  
  <p>The next thing is to avoid text boxes with <code>autocomplete</code> disabled. To the best of my knowledge, there're two ways to disable autocomplete:</p>
  
  <p>1> On the input itself.</p>
  
  <pre><code>&lt;input type="text" name="n1" id="idInput" autocomplete="Off" /&gt;
  </code></pre>
  
  <p>2> On the form element.</p>
  
  <pre><code>&lt;form id="form1" name="form1" method="post" autocomplete="off" action="someurl.com"&gt;
  </code></pre>
  
  <p>So I'm currently using the following method to find out if an element has autocomplete off:</p>
  
  <pre><code>//Called from within extension's content script
  function isAutocompleteOff(elmt)
  {
      var ac = elmt.autocomplete;
      if(ac)
      {
          if(ac.toLowerCase() == 'off')
              return true;
      }
  
      //Try form element itself
      ac = elmt.form.autocomplete;
      if(ac)
      {
          if(ac.toLowerCase() == 'off')
              return true;
      }
  
      return false;
  }
  
  var elmt = document.getElementById("idInput");
  if(!isAutocompleteOff(elmt))
  {
      //Use this control
  }
  </code></pre>
  
  <p>The method above seems to work, except on this particular page that I tested it on, when the form comes up to fill out the credit card information the input field does not have the <code>autocomplete="off"</code> on it. Here it is from the Chrome debugger:</p>
  
  <pre><code>&lt;input type="text" placeholder="Card Number" maxlength="16" 
   name="cc_number" id="cc_number" class="cc_number cc_number_required"&gt;
  </code></pre>
  
  <p>neither does the form element:</p>
  
  <pre><code>&lt;form name="aspnetForm" method="post" action="https://pageurl.com"
   id="aspnetForm" _lpchecked="1"&gt;
  </code></pre>
  
  <p>and my method above doesn't work on it, but Chrome still doesn't show its auto-fill option for that text box (although it does so on other text boxes on that same page.)</p>
  
  <p>So thus my question. <strong>How else can webpages disable autocomplete in Chrome?</strong></p>