내가 만드는 자동완성 chrome extension. 즉,일단 버튼을 눌러 입력 폼에서 콘텐츠를 웹 페이지에 의해 채워에서 텍스트 popup.html. 나이"읽을 수 없는 속성의 null"오류가 발생 어디에서 추가신을 내 버튼입니다. [Catch 되지 않는 형식 오류:읽을 수 없는 속성의 null(독서'매개 변')][1]
여기에 내에 html 파일
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Autofill</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<p id="testText">Text to put</p>
<button id="fillForm">Fill!</button>
<script src="app.js" ></script>
</body>
</html>
여기에 나 app.js
console.log('background running!!!')
let testtext = document.getElementById('testText')
let button = document.getElementById('fillForm')
button.addEventListener('click', buttonClick);
function buttonClick(){
params = {
active: true,
currentWindow: true
}
chrome.tabs.query(params, gotTabs);
function gotTabs(tabs){
let text = testtext.innerHTML
let content = {
username: text
}
chrome.tabs.sendMessage(tabs[0].id, content);
}
}
여기에 나 content.js
console.log("Receiving message...")
chrome.runtime.onMessage.addListener(gotMessage);
function gotMessage(message, sender, sendReponse){
document.getElementById('email').value = content.username
}
마지막으로,내 나타납니다.json
{
"name": "Resume Autofiller",
"description": "Build an Extension!",
"version": "1.0",
"manifest_version": 2,
"browser_action":{
"default_popup": "index.html"
},
"permissions": [
"activeTab",
"<all_urls>"
],
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": [ "content.js" ]
}
],
"background": {
"scripts": ["app.js"]
}
}
내가 온라인으로 읽는 내가 내 스크립트 태그의 맨 아래에 몸을 태그,하지만 나는 아직도 이 오류가 있습니다. 나는 같은 느낌이 나는 감독하는 뭔가가 분명하다,따라서 어떤 도움을 진심으로 감사합니다. 감사합니다! 첨부되어 오류가 나 얻고 있다. [1]: https://i.stack.imgur.com/GyNXO.png