Super-Progressive-Web-Apps icon indicating copy to clipboard operation
Super-Progressive-Web-Apps copied to clipboard

e.request.mode === 'navigate'

Open petertenhoor opened this issue 6 years ago • 1 comments

Hi!

First of all; great work on this plugin!

In the service worker generated by the Super PWA plugin I noticed this line:

https://github.com/SuperPWA/Super-Progressive-Web-Apps/blob/05ef8b38344cebd9c9575d01ea471666f7c8c3f0/public/sw.php#L232

But when I console.log e.request.mode in my application it only returns "cors", "no-cors" and "same-origin" and never "navigate". So basically this statement is never true and assets are always served from the cache instead of fetched from the network when the client has an internet connection.

After removing that part of the if statement the service worker does exactly what I want: if there is an active internet connection -> fetch all assets from the server , if not -> fetch them from the cache.

Why is the request mode if statement there and when is the request mode supposed to be "navigate"?

Best regards,

Peter ten Hoor

petertenhoor avatar Feb 05 '19 21:02 petertenhoor

Hello @petertenhoor

Thanks for the kind words.

Did you enable "Preserve log" for the console? Navigate is not logged otherwise - https://jmp.sh/JM9ZiOl

navigate happens when you click on any link.

arunbasillal avatar Feb 10 '19 02:02 arunbasillal