chromium/third_party/blink/web_tests/external/wpt/content-security-policy/script-src/support/worker-with-script-src-none-importscripts.js

var message = "importScripts allowed";
try {
    importScripts("/content-security-policy/support/post-message.js");
} catch (e) {
    message = "importScripts blocked";
}

if (typeof SharedWorkerGlobalScope === "function") {
  onconnect = function (e) {
    var port = e.ports[0];

    port.onmessage = function () { port.postMessage(message); }
    port.postMessage(message);
  };
} else if (typeof DedicatedWorkerGlobalScope === "function") {
  self.postMessage(message);
}