I have a site which have this element :
<input type="text" id="editpane_title" fnk="tt" maxlength="80" name="title" value="st benedict crucifix">
And I want to get and set value of that input using Chrome Extension :
{
"manifest_version": 2,
"name": "demo",
"version": "1.0",
"description": "demo",
"icons": { "16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png" },
"background": {
"scripts": ["background.js"],
"persistent": false
},
"permissions": [ "tabs" ],
"browser_action": {
"default_icon": {
"16": "icon16.png",
"24": "icon24.png",
"32": "icon32.png"
},
"default_title": "demo"
}
}
and here's background.js
:
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.tabs.query({ active: true, lastFocusedWindow: true }, function (tabs) {
var title = document.getElementById('editpane_title').value;
alert(title);
});
});
and the alert is not showing up at all. I tried reload multiple times but still failed.
what did I missed here?