I have this js function in my web page html code.
function update() {
document.getElementById( "textbox ").value = updatetext;
}
When I execute "update()" from chrome console, it works.
But if I execute from chrome extension,
chrome.tabs.executeScript(tab.id, {code: "update();"}, function(result){});
It says update is not defined. But if I replace with "alert('ok')", It works.
Then I execute
eval("update()")
in Chrome extension content script. It also says "update is not defined."
So what can i do to call js function on web page?