I'm somewhat new to javascript and long story short, I'm trying to build my own autofill for my school login page using a chrome extension.
After looking through the source code and creating an html file copy of the webpage I figured out the username box ID was 'Username' and the password box ID was 'Password' (who would've guessed?) I ran a a test on the fake html page and I got it to put in my saved password and username. However, when I go to try in the chrome extension it won't work.
Here's how my manifest and content script looks:
Manifest:
`content_scripts": [
{
"run_at": "document_idle",
"matches": ["*://elearn.apsu.edu/*"],
"js": ["content.js"]
}
],
"permissions": [
"activeTab", "tabs", "http://elearn.apsu.edu/", "https://elearn.apsu.edu/"
]`
My content.js file has this:
`window.onload = function(){
document.getElementById("Username").value = "*username*";
document.getElementById("Password").value = "*password*"; };`
I've also tried setting up my content.js like this, but it hasn't worked either:
`document.addEventListener('DOMContentLoaded', info, false);
info = function(){
document.getElementById("Username").value = "*username*";
document.getElementById("Password").value = "*password*";
};
`
Anyone have some advice that might help?