As a beginner, I am sorry to say that I don't know how to invoke a function which is defined in webpage index.html from a google chrome extension.
I want to change two fields in the page i am able to change one textbox field, the second one is a selection box and there is a jquery function to be invoked to add items in selection box.Is it possible to invoke it from my extension.
My manifest file
{
"name": "My First Extension",
"version": "1.0",
"manifest_version": 2,
"description": "The first extension that I made.",
"browser_action": {
"default_icon": "icon.png"
},
"permissions": [
"tabs", "https://*/*"
],
"content_scripts": [
{
"matches": ["https://*/*"],
"js": ["jquery-1.7.2.min.js","content.js"],
"run_at": "document_end"
}
]
}
My content.js
var subdist = document.getElementById('ContentPlace');
subdist.value="5673";
Webpage : index.php
The function to be invoked to update the selection box is :
onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolderMainContent$DropDownVillage\',\'\')', 0)"
Referred to: Chrome call function in content scripts from background.js
Calling Content Script function on chrome.browserAction.onClicked