Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I need to be able to prevent the Save Password bubble from even showing up after a user logs in.

Autocomplete=off is not the answer.

I have not come across a post that offers a secure solution for this issue. Is there really no way to disable the password bubble in Chrome??

like image 335
Cognitronic Avatar asked Apr 20 '14 00:04

Cognitronic


People also ask

Is there a way to disable showing saved Passwords in Google Chrome?

Chrome. Click the Chrome menu in the toolbar and choose Settings. Click Passwords. Turn off Offer to save passwords.

How do I stop my browser from asking to save Passwords?

Method 1: One of the known methods is to use autocomplete attribute to prevent browser to remember the password. In the input field, if we define autocomplete=”off” then many times the input value is not remembered by the browser.

What does do not allow AutoComplete to save Passwords?

Tap on the three dot menu icon. Tap Settings. Tap Save passwords. Slide Save passwords off.


2 Answers

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();     } 
like image 146
Leon Avatar answered Sep 20 '22 08:09

Leon


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.

like image 25
Vadim Avatar answered Sep 24 '22 08:09

Vadim