How to get/set input in chrome new tab

92 views
Skip to first unread message

NDJ

unread,
Feb 22, 2023, 2:09:00 AM2/22/23
to Chromium Extensions

image

<h1>북마크 추가</h1> <br/><br/><br/> <form id="bookMarksAddPopForm"> <div class="form-group"> <label for="addnameInp">사이트 명</label> <input type="text" class="form-control" id="addnameInp" placeholder="사이트명을 입력하세요." value=""> <small id="emailHelp" class="form-text text-muted"></small> </div> <div class="form-group"> <label for="addurlInp">URL</label> <input type="url" class="form-control" id="addurlInp" placeholder="URL을 입력하세요." value=""> </div> </form>

As shown in the picture, there are two inputs. You cannot change or get input values ​​with javascript and jquery. Is my approach wrong?

example)
document.querySelector('#addnameInp').value = "test";
$('#addnameInp').val("test");

manifest.json is using version 3. Thank you in advance.

wOxxOm

unread,
Feb 22, 2023, 8:10:22 AM2/22/23
to Chromium Extensions, NDJ
Try the old document.execCommand as shown in https://stackoverflow.com/a/57900849

NDJ

unread,
Feb 22, 2023, 11:21:53 AM2/22/23
to Chromium Extensions, wOxxOm
That issue has been resolved. Another external script was manipulating the dom. 🤣 Thanks for the answer.

2023년 2월 22일 수요일 오후 10시 10분 22초 UTC+9에 wOxxOm님이 작성:
Reply all
Reply to author
Forward
0 new messages