In the following snippets, how can I make this run when tab load is done instead of click? I tried to find load event instead of chrome.browserAction.onClicked.addListener
but can't find anything.
background.js
chrome.browserAction.onClicked.addListener(function (tab) {
chrome.tabs.executeScript(tab.ib, {
file: 'dosomething.js'
});
});
dosomething.js
(function() {
setTimeout(function(){
alert('Doing Something!...');
$('body').css('background','red');
}, 3000);
})();
manifest.json
{
"name": "DoingSomethng",
"version": "0.0.1",
"manifest_version": 2,
"background": {
"scripts": [
"background.js"
],
"persistent": true
},
"browser_action": {
"default_title": "Something!"
},
"permissions": [
"https://*/*",
"http://*/*",
"tabs"
]
}