How do I disable the save password bubble in chrome using Javascript? How do I disable the save password bubble in chrome using Javascript? google-chrome google-chrome

How do I disable the save password bubble in chrome using Javascript?


I found there is no "supported" way to do it.

What I did was copy the password content to a hidden field and remove the password inputs BEFORE submit.

Since there aren't any passwords fields on the page when the submit occurs, the browser never asks to save it.

Here's my javascript code (using jquery):

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


After hours of searching, I came up with my own solution, which seems to work in Chrome and Safari (though not in Firefox or Opera, and I haven't tested IE). The trick is to surround the password field with two dummy fields.

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

Here's the CSS I used:

.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;}

Note: The dummy input fields can no longer be hidden with display: none as many have suggested, because browsers detect that and ignore the hidden fields, even if the fields themselves are not hidden but are enclosed in a hidden wrapper. Hence, the reason for the CSS class which essentially makes input fields invisible and unclickable without "hiding" them.


Add <input type="password" style="display:none"/> to the top of your form. Chrome's autocomplete will fill in the first password input it finds, and the input before that, so with this trick it will only fill in an invisible input that doesn't matter.