How do I disable Google Chrome Pop-Up to save passwords?

6

How would a method to disable Pop-Up:

  

Do you want Google Chrome to update your password for this site?

Feelfreetochoosethelanguage,buttheanswerwithJavaScriptwillbetheacceptedanswer.

Nota: AutoComplete='Off' indicates to the browser that you do not need to display options based on previous values, so that's not what I want.

    
asked by anonymous 07.08.2017 / 15:52

2 answers

5

By comment from @Wallace Maxters, I discovered that nowhere exactly says how to disable this Pop-UP (correct) , but there are means of cheat this.

Why does this happen?

Whenever a form with <input type="password"> is sent the Chrome will ask the Pop-UP question.

And what is the solution to this?

Add 2 fake fields next to your password field.

<input type="password" class="stealthy" tabindex="-1">
<input type="password" " id="user_password" autocomplete="off">
<input type="password" class="stealthy" tabindex="-1">

And use the following CSS

.stealthy {
  left: 0;
  margin: 0;
  max-height: 1px;
  max-width: 1px;
  opacity: 0;
  outline: none;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  top: 0;
  z-index: -1;
}

The reason for class CSS is make fields invisible and declassified.

    
07.08.2017 / 16:06
1

We can not disable this function directly via Javascript, as this is a browser configuration. But we can use a code to "cheat" this ...

You can try to copy the password to a 'hidden' field and remove it from the 'original' input, before sending the 'submit'; Example:

function executeAdjustment(){       
    $("#vPassword").val($("#txtPassword").val());
    $(":password").remove();        
    var myForm = document.getElementById("createServerForm");
    myForm.action = "executeCreditAdjustment.do";
    myForm.submit();
}

Ref. Stack

    
07.08.2017 / 16:04