In Google chrome extension, background.js's execute script isn't load file.
background.js
chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) {
chrome.tabs.executeScript(tabId, {
file: 'index.js'
});
});
manifest.json
{
"manifest_version": 2,
"permissions": [
"activeTab",
"declarativeContent",
"storage",
"tabs",
"file://*/*",
"https://*/*",
"http://*/*"
],
"background": {
"scripts": ["js/jquery.min.js", "js/background.js"],
"persistent": true
},
}
Errors are,<br>
1. Unchecked runtime.lastError: Cannot access a chrome:// URL <br>
2. Unchecked runtime.lastError: Failed to load file: "index.js".<br>
3. Unchecked runtime.lastError: Cannot access contents of url "chrome-search://local-ntp/local-ntp.html". Extension manifest must request permission to access this host.