lib/WorkerHandler.js
function getDefaultWorker() {
  if (environment.platform == 'browser') {
    // test whether the browser supports all features that we need
    if (typeof Blob === 'undefined') {
      throw new Error('Blob not supported by the browser');
    }
    if (!window.URL || typeof window.URL.createObjectURL !== 'function') {
      throw new Error('URL.createObjectURL not supported by the browser');
    }

    // use embedded worker.js
    var blob = new Blob([require('./generated/embeddedWorker')], {type: 'text/javascript'});
    return window.URL.createObjectURL(blob);
  }
  else {
    // use external worker.js in current directory
    return __dirname + '/worker.js';
  }
}
function getDefaultWorker() {
  if (environment.platform == 'browser') {
    // test whether the browser supports all features that we need
    if (typeof Blob === 'undefined') {
      throw new Error('Blob not supported by the browser');
    }
    if (!window.URL || typeof window.URL.createObjectURL !== 'function') {
      throw new Error('URL.createObjectURL not supported by the browser');
    }

    // use embedded worker.js
    var blob = new Blob([require('./generated/embeddedWorker')], {type: 'text/javascript'});
    return window.URL.createObjectURL(blob);
  }
  else {
    // use external worker.js in current directory
    return __dirname + '/worker.js';
  }
}
function getDefaultWorker ( ) { if ( environment . platform == 'browser' ) { // test whether the browser supports all features that we need if ( typeof Blob === 'undefined' ) { throw new Error ( 'Blob not supported by the browser' ) ; } if ( ! window . URL || typeof window . URL . createObjectURL !== 'function' ) { throw new Error ( 'URL.createObjectURL not supported by the browser' ) ; } // use embedded worker.js var blob = new Blob ( [ require ( './generated/embeddedWorker' ) ] , { type : 'text/javascript' } ) ; return window . URL . createObjectURL ( blob ) ; } else { // use external worker.js in current directory return __dirname + '/worker.js' ; } }
get the default worker script
get the default worker script