Disable browser 'Save Password' functionality

前端 未结 30 3357
失恋的感觉
失恋的感觉 2020-11-21 23:29

One of the joys of working for a government healthcare agency is having to deal with all of the paranoia around dealing with PHI (Protected Health Information). Don\'t get m

30条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-21 23:48

    My js (jquery) workaround is to change password input type to text on form submit. The password could become visible for a second, so I also hide the input just before that. I would rather not use this for login forms, but it is useful (together with autocomplete="off") for example inside administration part of the website.

    Try putting this inside a console (with jquery), before you submit the form.

    $('form').submit(function(event) {
        $(this).find('input[type=password]').css('visibility', 'hidden').attr('type', 'text');
    });
    

    Tested on Chrome 44.0.2403.157 (64-bit).

提交回复
热议问题