I am trying to inject some js file while tab open.So, on tab open i execute
chrome.tabs.onCreated.addListener(function callback(tab, info) {
chrome.tabs.executeScript(tab.id, {
file: "executeScript.js"
});
});
but some time it works ,some time i am getting
Cannot access contents of url "https://www.google.com/_/chrome/newtab?rlz=1C1CHZL_enIN708IN708&ie=UTF-8". Extension manifest must request permission to access this host. error. i have added * ://*/ * , in manifest file permission but no luck.
manifest.json
"background": {
"scripts": ["socket.io.js", "eventPage.js","jquery-3.1.0.min.js","jquery-confirm.min.js"],
"persistent": false
},
"content_scripts": [{
"matches": ["*://*.amazon.com/*", "*://*.amazon.co.uk/*","*://*.amazon.ca/*"],
"js": ["socket.io.js", "content.js", "jquery-3.1.0.min.js", "custom-socket.js","jquery-confirm.min.js"],
"css": ["content.css","jquery-confirm.min.css"],
"run_at" : "document_start",
"all_frames" : true
}],
"permissions": [
"*://*/*",
"activeTab",
"tabs",
"storage",
"identity",
"identity.email",
]