0

I am trying to make a form filler chrome extension, and I am getting no errors when it interact with the extension, but when I click the button on the chrome extension fields on the job application form are still not getting filled in.

manifest-

{
"name": "Jabord",
"version": "1.0",
"manifest_version": 2,
"description": "Fill forms",
"content_scripts": [{
    "matches" :
["https://boards.greenhouse.io/vimeo/jobs/1837092"],
    "js" : ["popup.js"]
}],
"browser_action": {
    "default_popup": "popup.html",
    "default_icon" : "download.png"
}

}

popup.html-

<html>
<body>
<button type="button" id="fill">Fill</button><br>
<script src="popup.js"></script>
<body>
</html>

popup.js-

document.getElementById("fill").onclick = Fill;


function Fill(){
document.getElementById("first_name").innerHTML = 
"somefirstname";
}
AJ2796
  • 1
  • 2
  • You have to use a content script. Right now all your code runs on your extension's popup window. – Iván Nokonoko Aug 28 '19 at 22:42
  • There is look at the manifest – AJ2796 Aug 28 '19 at 22:43
  • There are errors, you just look in the wrong place. Right-click inside the popup, click "inspect", and a devtools window will open for the popup. There'll be an error. Like I said multiple times in your previus questions, you need a separate content.js file as a content script and you need to control the content script from your popup script as shown in many answers/tutorials on this topic, including the [one I've linked](/a/4532567). – wOxxOm Aug 29 '19 at 04:32
  • When you try `document.getElementById` inside of the popup, it causes an error because there is no element in your popup.html file. I assume your trying to run that code onto the page that the user is viewing. To do this you need to use a content script. You can interact with the content script using a background script that connects your popup and content scripts. – WhiteFire356 Aug 31 '19 at 23:58

0 Answers0