I want to host my javascript file instead of packing it with the extension. I have read about whitelisting cross domain with Content Security Policy. This is what I have, but it throws error
"Could not load javascript '' for content script."
manifest.json
{
"name": "My Chrome App",
"version": "1.0",
"manifest_version": 2,
"content_scripts": [{
"matches": ["<all_urls>"],
"js": ["https://example.com/platform/myjs.js"],
"run_at": "document_end"
}],
"background": {
"scripts":["background.js"]
},
"description": "My app description goes here", //on hover
"icons": {
"128": "icon.png"
},
"browser_action": {
"default_title": "My Chrome App",
"default_popup": "popup.html"
},
"permissions": [
"http://*/*", "https://*/*","tabs"
],
"content_security_policy": "script-src 'self' https://example.com; object-src 'self'"
}
Is it impossible what I am trying to do? Or is there a workaround? I cannot find an updated answer to this question since CSP has been updated a couple years ago.
UPDATE: As suggested by @PredatorIWD I looked at this answer but I am receiving the following error when I inspect views of background page:
Unchecked runtime.lastError while running tabs.executeScript: Cannot access a chrome:// URL
I was confused about why until I found this answer which solved my problem.