0
I am creating an extension that fills a form of a particular web page, but I am with a problem, the code does not run either automatically and even when clicking on the extension, I am very lost.
manifest.json
{
"name": "SGIR - Extensão",
"manifest_version": 2,
"version": "1.0",
"description": "Preencher formulários",
"browser_action": {
"script": ["funcao.js"]
},
"permissions": ["tabs"]
}
function.js
chrome.window.onload = function(){
var ni = document.getElementById("NI");
ni.action = "Alguma coisa!";
};
I understood his explanation, but even so, when I click on the extension icon nothing happens on the page I’m on, it does not complete the form, in case the text field with id="NI", which may be wrong?
– neto schneider
In the case of inputs, the correct is
ni.value = "Alguma coisa!";
.– Valdeir Psr
I tried with "value" too, but nothing happens on the page, it just opens the extension popup...
– neto schneider
@netoschneider I edited my answer. This way it will work either automatically, or by clicking on the extension icon.
– Valdeir Psr
Thank you very much, cleared my doubt!
– neto schneider