简体   繁体   中英

safari wants to use the login keychain

safari wants to use the login keychain for website xyz coming continuously.

-- on page load

-- onfocus in email_id field

-- onkeypress email_id

How to prevent these without disturbing autofill functionality throgh HTML changes or js(js or jquery) in my site

i search this problem before day for my project. and finally i found the solution wit plug-in below.

this plug-in work structure like this. It get your input and clone it. Use this clone and create same input properties and clone it another hidden input. After that remove your orginal input and put hidden and cloned input same position.

It's reason that. Modern browser (has keychain) control input (type password) when page loaded and mapped over DOM. After page load plug-in get input and clone and remove orginal input. this operation changes DOM mapping. So brovser cannot access this control when page redirect. So don't suggest yo to save password.

You can use this plug-in for this problem.

Notes:

If you use another plug-in like me. Forexample jquery-keyboard plug-in for password secure enter. you shoul modify your initkeyboard method. becasue keyboard control your input and init near this input. you could change this init method like below init keyboard changing

before

var _inputwidth = $(elm).parent().find('input').width();

after var _inputwidth = $(elm).parent().find('input[type=text],input[type=password]').width();

because plug-in output like this

<input type="hidden"  id="txtPass" name="txtPass" spellcheck="false" autocomplete="off">
<input type="text"  id="txtPass" name="txtPass" spellcheck="false" autocomplete="off">

If you have any keypress or keydown event initialize for this input put this codes after plug-in init. because this plug-in change DOM mapping this plug-in usage like below

$('input[type=password]').disableAutocomplete();

this is creator desctiption

This jQuery plug-in enforces the autocomplete=off HTML attribute on password (and other) fields. Recent browsers have chosen to ignore this attribute in favor of user preferences. However, some financial (and other) institutions may have good reasons to enforce this practice.

jQouery Disable AutoComplete

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM