The Service Worker bypass for network doesn't work
Reported by
bustyasi...@gmail.com,
Oct 16
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3581.0 Safari/537.36 Steps to reproduce the problem: 1. I have the 'bypass for network' ticked (when I was on the website I wanted sw to not work) 2. I make sure the service worker is unregistered and clear the cache 3. I close Canary Browser 4. I open the same website and the service worker has loaded What is the expected behavior? For the Service worker NOT to be loaded What went wrong? Just seems to not work? Did this work before? N/A Chrome version: 72.0.3581.0 Channel: n/a OS Version: 6.1 (Windows 7, Windows Server 2008 R2) Flash Version: Should I have upload on reload ticked as well? But I just dont want the service worker loading at all - because I am developing the website.
,
Oct 16
Could you go to about:flags, search for "enable network service" (Without quotes), disable the network service, restart Chrome, and see if the issue goes away?
,
Oct 16
Do you see FetchEvent objects being dispatched or a value for navigator.serviceWorker.controller? I think the "bypass for network" setting just suppresses FetchEvent and avoids setting the controller attribute as normal. If your page calls navigator.serviceWorker.register(), though, it will still create and start a service worker.
,
Oct 16
,
Oct 17
Yes the screenshot looks as expected. Bypass for Network just suppresses FetchEvents. If you don't want service worker registered at all, your best option is probably to block cookies for the site.
,
Oct 17
Thanks for replies! 5: "If you don't want service worker registered at all, your best option is probably to block cookies for the site." The problem is that I want to turn off the service worker when I login to the backend of the website I am developing and so I need cookies turned on for the login! 4: "Do you see FetchEvent objects being dispatched or a value for navigator.serviceWorker.controller?" No. 3: "Could you go to about:flags, search for "enable network service" (Without quotes), disable the network service, restart Chrome, and see if the issue goes away?" That has worked. -------------------- Is it possible to have a proper feature in Google Canary to address this. Where developers can turn off the service worker to the backend of their websites they are working on and be able to test the frontend on a different tab.
,
Oct 17
Chrome tends to not have options, so I don't think adding an option for service workers enabled vs disabled will ever be implemented. I'm not sure I understand the use case... how does service worker enabled stop you from developing the website? I'm surprised about your answer about network service. Are you saying when network service is disabled, you see different behavior about service workers? Another option is disabling JavaScript, but I suspect that won't let you test the frontend of your website.
,
Oct 19
After testing comment 2 does not fix the problem. Basically the problem is that when I try to login to the backend of the cms the service worker is cache things and messing things up. I did some research and the following solution found here worked for me: https://love2dev.com/blog/how-to-uninstall-a-service-worker/ With regards to Google Chrome / Canary. I know you guys now use Site Isolation, so I thought maybe now it could be possible to have one tab allowing a service worker and another tab to block the service worker. |
||||
►
Sign in to add a comment |
||||
Comment 1 by bustyasi...@gmail.com
, Oct 1629.6 KB
29.6 KB View Download