NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: peterH on July 21, 2019, 01:34:51 PM
-
In the log for a NT10.35 server app I'm seeing lots of "GET /serviceworker.js" - is that to be expected? I can't even find that script anywhere. And what is it supposed to do for a server app?
Peter
-
>> In the log for a NT10.35 server app I'm seeing lots of "GET /serviceworker.js" - is that to be expected?
yes. The browser is asking for serviceworker.js. It doesn't exist in your case (which is fine) - but the browser keeps asking to be sure.
>> I can't even find that script anywhere.
You won't because it's not being generated for you. And indeed, it's not your _web app_ that's asking for it. It's a _browser_ thing - just like favicon.ico -the browser asks for that as well.
>> And what is it supposed to do for a server app?
The short answer is that it allows your web app to use various APIs in the browser which require service workers. NetTalk 11 generates it for you in some cases (it's optional) but I think it might come more and more into play. It's mostly used by "apps" level at the moment but I _may_ (or may not) move it down to server level, depending on what I need to use it for.
Cheers
Bruce
-
Hi Bruce,
Thanks for the clarification/explanation. I do have NT11 Apps as well but just haven’t noticed it in NT10 before.
Peter
-
Hi Peter,
If you are testing on "the same address" - like say 127.0.0.1 - and you test with "apps" (some app that has a serviceworker) then that's "registered" in the browser, even when you go back to say an NT10 app.
You can unregister the service worker in Developer Tools, Application tab, Service-Workers section.
>> You won't because it's not being generated for you. And indeed, it's not your _web app_ that's asking for it. It's a _browser_ thing - just like favicon.ico -the browser asks for that as well.
This is "sort of" wrong. (apologies). The request is coming from the browser, not the app, but it's because you _already_ have a service worker on that URL which is looking for an update. So yes, it's coming from the browser, but only because you put it there.
cheers
Bruce
-
Hi Bruce,
Now, that really makes sense. I Think I started seeing it after I upgraded my NT11 from Server to Apps (on the same machine) so there you go.
Thanks
Peter