I have https://domain1.com (domain1) and https://domain2.com (domain2).
Domain2 serves a page containing javascript with this header:
"Access-Control-Allow-Origin: *"
Domain1 runs some javascript code that invokes:
new Worker("//domain2.com/script.js")
Browsers throw security exceptions.
Since starting writing this question, I have got around this problem by ajaxing the script, blobbing it and running it from that, but am I missing something in the original idea?