('serviceWorker' in navigator) {
        navigator.serviceWorker
        .register('pdftex-service-worker.js')
        .then(function (reg) {
          // registration worked
          console.log(
            'Pdftex service worker registration succeeded. Scope is ' +
            reg.scope
          )
          // Optionally you can preload the worker and the resources for a
          // fasterinitial compilation. You should only do that if the service
          // worker is activated
          if (reg.act