I'm making a Chrome extension and I need it to find any form text-boxes on the webpage.
I first tried doing it in my content script like:
document.getElementsByTag("text");
But it always returns undefined
so I'm assuming it's searching only my_app.html
.
My first question is what function should I use: GetElmentsByTag, by name, by className, or with some other function?
My second question is which JavaScript file do I need to search? Other forums with similar problems said you need to access the DOM in another file like background or popup and then send it to the content script with a message and a listener.