I wan't to run my chrome extension as soon as the web page the user is visiting completes loading.
The extension works fine if I click it but I want it to run automatically on page load.
Is there any way to do this?
Here is my manifest
{
"manifest_version": 2,
"name": "Simple Text Highlighter",
"description": "This plugin notify of the word 'Simple' in the current page",
"version": "1.0",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"content_scripts": [{
"matches": ["http://*/*", "https://*/*"],
"js": ["jquery.min.js", "highlightSimple.js"],
"css": ["highlight.css"],
"run_at": "document_end"
}],
"permissions": [
"tabs",
"activeTab",
"notifications",
"http://*/",
"https://*/"
]
}
and here is the JavaScript
(function () {
chrome.tabs.executeScript(null, {
file: 'highlight.css'
}, function () {
chrome.tabs.executeScript(null, {
file: 'jquery.min.js'
}, function () {
chrome.tabs.executeScript(null, {
file: 'replace.js'
});
});
})
})();
Thanks in advance.