I'm trying to create a Web Worker from my extension's content script, but it's getting blocked by a SecurityError (same origin policy). What's the best way to do this?
From my content script:
var workerURL = chrome.extension.getURL("js/searchWorker.js");
var lunrWorker = new Worker(workerURL);
From the manifest:
"content_scripts": [
{
"matches": ["http://localhost:8000/*"],
"js": ["js/jquery.min.js", "js/jquery.highlight.js", "js/index.js"],
"css": ["css/bootstrap.css", "css/styles.css"]
}
]
I also tried setting this in my manifest, but it didn't help:
"content_security_policy": "default-src 'none'; style-src 'self'; script-src 'self';",
(Sidenote: the CSS isn't being injected into the page, I'm not sure if that's a symptom of the same problem or unrelated)