= 'SecurityError' &&
            document.location.protocol === 'file:') {
          div.innerHTML += "<b>You need to open this HTML file from a web server; web workers don't work with <code>file:</code> protocol.</b>";
        }
        document.body.appendChild(div);
      }
      window.onload = function() {
        try {
          worker = new Worker('tex2svg.js');
        } catch (e) {
          error(e);
        }
        worker.onerror = function(e) {
          error('Failed to load worker');
       