New issue
Advanced search Search tips

Issue 895869 link

Starred by 3 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Oct 17
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

The Service Worker bypass for network doesn't work

Reported by bustyasi...@gmail.com, Oct 16

Issue description

UserAgent: 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.
 
See screenshot when I re-open the Browser.

(Note it uses a double Service Worker with OneSignal and sw file - just to let you know).
double-service-worker.png
29.6 KB View Download
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?
Components: Blink>ServiceWorker
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.
Labels: Needs-Triage-M72
Status: WontFix (was: Unconfirmed)
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.
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.


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.
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