개발정리

[HTML] 크롬 input 로그인 아이디 비밀번호 자동완성 막기

이피라인 2021. 1. 19. 16:27
728x90
300x250
 org.jsoup.nodes.Document doc = Jsoup.parse(status);
Elements inputId = doc.select("input.inputBox[name=hiworks_id]");
inputId.attr("autocomplete", "off");
String idInput ="<input type=\"text\" name=\"id_fake\" class=\"inputBox\" autocomplete=\"off\" style=\"display:none;\"/>";
inputId.prepend(idInput);
Elements input = doc.select("input.inputBox[name=hiworks_pw]");
input.attr("autocomplete", "new-password");
String apInput ="<input type=\"password\" name=\"pw_fake\" class=\"inputBox\" autocomplete=\"new-password\" style=\"display:none;\"/>";
input.prepend(apInput);

rest로 가져오는 html을 jsoup로 기존 input앞이나 뒤로

html 형태의 fake input을 집어넣고

new-password attr 을 new-password 로 

설정해주어서 해결함

728x90
300x250

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

로컬 SSL 필요시 세팅 방법  (0) 2021.01.20
[JSTL core] [c:forEach] varStatus를 활용한 변수  (0) 2020.12.07