본문 바로가기
개발

크롬에서 input text에 아이디가 채워지는 현상

by 혈중마라농도 2022. 9. 22.

크롬 기반 브라우저는 로그인 시 아이디와 비밀번호를 저장하는 기능이 있다.

크롬 로그인 정보 저장 기능

여기서 "저장"을 누르게 되면 브라우저에 아이디와 비밀번호가 저장이 되고, 해당 도메인에서 뜻하지 않게 input text에 아이디가 채워지는 효과가 있다.

크롬 AutoFill 기능

https://stackoverflow.com/questions/15738259/disabling-chrome-autofill

 

Disabling Chrome Autofill

I have been running into issues with the chrome autofill behavior on several forms. The fields in the form all have very common and accurate names, such as "email", "name", or "password", and the...

stackoverflow.com

위의 stackoverflow 기준으로 여러가지를 시도해 봤지만, 전혀 먹히지 않았다.
autocomplete="off"
autocomplete="new-password"
autocomplete="do-not-autofill"

그러다가 아래의 코드로 해결을 했다.

readonly onfocus="this.removeAttribute('readonly');"

다른 방법도 여러가지 있긴 했는데, 전역설정?과도 같은 부분으로 fix한 것이 많아 위와 같은 기능을 선택하였다.

반응형

'개발' 카테고리의 다른 글

IIS 에러 페이지 설정  (0) 2022.07.18
Cookie 설정  (0) 2022.05.17
C# Sharepoint tCompressedString to string(xml)  (0) 2022.02.02
IIS Header Server, x-aspnet-version, x-powered-by 제거하기  (0) 2022.01.24
Window10 NVM 설치하기  (0) 2022.01.03

댓글