message: fix(createWebworkerPromise): Support fetching from other domains
diff: +import axios from 'axios'
  import WebworkerPromise from 'webworker-promise'
  import config from '../../itkConfig.js'
  @@ -36,6 +37,28 @@ async function createWebworkerPromise (name: 'image-io' | 'mesh-io' | 'pipeline'
  const min = 'min-'
  // debug
  // const min = ''
  +
  + if (webWorkersUrl.startsWith('http')) {
  + switch (name) {
  + case 'image-io': {
  + const response = await axios.get(`${webWorkersUrl}/${min}bundles/image-io.worker.js`, { responseType: 'blob' })
  + worker = new Worker(URL.createObjectURL(response.data))
  + break
  + }
  + case 'mesh-io': {
  + const response = await axios.get(`${webWorkersUrl}/${min}bundles/mesh-io.worker.js`, { responseType: 'blob' })
  + worker = new Worker(URL.createObjectURL(response.data))
  + break
  + }
  + case 'pipeline': {
  + const response = await axios.get(`${webWorkersUrl}/${min}bundles/pipeline.worker.js`, { responseType: 'blob' })
  + worker = new Worker(URL.createObjectURL(response.data))
  + break
  + }
  + default:
  + throw Error('Unsupported web worker type')
  + }
  + } else {
  switch (name) {
  case 'image-io':
  worker = new Worker(`${webWorkersUrl}/${min}bundles/image-io.worker.js`)
  @@ -49,6 +72,8 @@ async function createWebworkerPromise (name: 'image-io' | 'mesh-io' | 'pipeline'
  default:
  throw Error('Unsupported web worker type')
  }
  + }
  +
  const webworkerPromise = new WebworkerPromise(worker)
  return { webworkerPromise, worker }
  }
  