Re: [chromium-dev] Re: How to disable service worker in headless?

480 views
Skip to first unread message

Matt Falkenhagen

unread,
Oct 16, 2017, 12:08:04 AM10/16/17
to br...@dockyard.com, headle...@chromium.org
-chromium-dev, +headless-dev

You're correct that disabling cookies through Content Settings (chrome://settings/content/cookies) is the supported way of disabling service workers in Chrome (disabilng JavaScript also works). For headless, these issues may be relevant:
https://bugs.chromium.org/p/chromium/issues/detail?id=617931

On Sun, Oct 15, 2017 at 5:40 AM, Brian Cardarella <br...@dockyard.com> wrote:
I'm aware that disabling cookies disables service workers, but I do not see a flag to disable cookies either from command line

On Saturday, October 14, 2017 at 4:38:05 PM UTC-4, Brian Cardarella wrote:
Is there an flag to pass that would disable service workers from command line?

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/6694073f-65a9-4c88-8679-c7a37afd944c%40chromium.org.

dvallet (Chromium)

unread,
Oct 16, 2017, 12:20:01 AM10/16/17
to Matt Falkenhagen, br...@dockyard.com, headle...@chromium.org
I don't think there's any configuration setup to bypass ServiceWorkers atm.

A workaround would be to set up Network.setRequestInterceptionEnabled and just continue all requests. 
Afaik whatever gets caught by request interceptor should not be intercepted by Service Workers.

On Mon, 16 Oct 2017 at 15:08 Matt Falkenhagen <fal...@chromium.org> wrote:
-chromium-dev, +headless-dev

You're correct that disabling cookies through Content Settings (chrome://settings/content/cookies) is the supported way of disabling service workers in Chrome (disabilng JavaScript also works). For headless, these issues may be relevant:
https://bugs.chromium.org/p/chromium/issues/detail?id=617931
On Sun, Oct 15, 2017 at 5:40 AM, Brian Cardarella <br...@dockyard.com> wrote:
I'm aware that disabling cookies disables service workers, but I do not see a flag to disable cookies either from command line

On Saturday, October 14, 2017 at 4:38:05 PM UTC-4, Brian Cardarella wrote:
Is there an flag to pass that would disable service workers from command line?

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/CAJ_xCinPwpcdP9OWaFfNyWj-TtehK7CV3Lfy7DPriK6n%2BkKmiw%40mail.gmail.com.

Matt Falkenhagen

unread,
Oct 16, 2017, 12:34:15 AM10/16/17
to dvallet (Chromium), br...@dockyard.com, headle...@chromium.org
I'm not sure if Network.setRequestInterceptionEnabled affects service worker interception, especially when PlzNavigate is enabled we basically forward the request to the service worker before consulting with DevTools on any renderer process.

Network.setBypassServiceWorker also looks promising but it's currently broken in Chrome: https://bugs.chromium.org/p/chromium/issues/detail?id=746220

On Mon, Oct 16, 2017 at 1:19 PM, dvallet (Chromium) <dva...@chromium.org> wrote:
I don't think there's any configuration setup to bypass ServiceWorkers atm.

A workaround would be to set up Network.setRequestInterceptionEnabled and just continue all requests. 
Afaik whatever gets caught by request interceptor should not be intercepted by Service Workers.

On Mon, 16 Oct 2017 at 15:08 Matt Falkenhagen <fal...@chromium.org> wrote:
-chromium-dev, +headless-dev

You're correct that disabling cookies through Content Settings (chrome://settings/content/cookies) is the supported way of disabling service workers in Chrome (disabilng JavaScript also works). For headless, these issues may be relevant:
https://bugs.chromium.org/p/chromium/issues/detail?id=617931
On Sun, Oct 15, 2017 at 5:40 AM, Brian Cardarella <br...@dockyard.com> wrote:
I'm aware that disabling cookies disables service workers, but I do not see a flag to disable cookies either from command line

On Saturday, October 14, 2017 at 4:38:05 PM UTC-4, Brian Cardarella wrote:
Is there an flag to pass that would disable service workers from command line?

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.

--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev+unsubscribe@chromium.org.

dvallet (Chromium)

unread,
Oct 16, 2017, 12:41:31 AM10/16/17
to Matt Falkenhagen, br...@dockyard.com, headle...@chromium.org
Oh yeah, we tested this a while ago, maybe PlzNavigate has changed things.

When we did the tests, we realized RequestInterceptor is added in the StorageParticionImplMap, so my understanding is that if it intercepts a request, it wouldn't be intercepted by the Service Workers 

On Mon, 16 Oct 2017 at 15:34 Matt Falkenhagen <fal...@chromium.org> wrote:
I'm not sure if Network.setRequestInterceptionEnabled affects service worker interception, especially when PlzNavigate is enabled we basically forward the request to the service worker before consulting with DevTools on any renderer process.

Network.setBypassServiceWorker also looks promising but it's currently broken in Chrome: https://bugs.chromium.org/p/chromium/issues/detail?id=746220
On Mon, Oct 16, 2017 at 1:19 PM, dvallet (Chromium) <dva...@chromium.org> wrote:
I don't think there's any configuration setup to bypass ServiceWorkers atm.

A workaround would be to set up Network.setRequestInterceptionEnabled and just continue all requests. 
Afaik whatever gets caught by request interceptor should not be intercepted by Service Workers.

On Mon, 16 Oct 2017 at 15:08 Matt Falkenhagen <fal...@chromium.org> wrote:
-chromium-dev, +headless-dev

You're correct that disabling cookies through Content Settings (chrome://settings/content/cookies) is the supported way of disabling service workers in Chrome (disabilng JavaScript also works). For headless, these issues may be relevant:
https://bugs.chromium.org/p/chromium/issues/detail?id=617931
On Sun, Oct 15, 2017 at 5:40 AM, Brian Cardarella <br...@dockyard.com> wrote:
I'm aware that disabling cookies disables service workers, but I do not see a flag to disable cookies either from command line

On Saturday, October 14, 2017 at 4:38:05 PM UTC-4, Brian Cardarella wrote:
Is there an flag to pass that would disable service workers from command line?

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
Reply all
Reply to author
Forward
0 new messages