Testing Service Workers > Development > Served via http on a LAN

27 views
Skip to first unread message

Tim Bradley

unread,
Apr 2, 2018, 11:45:11 AM4/2/18
to Chrome DevTools
How to test service workers for application being service via http on a LAN in development?

Is there a particular port to specify? 

Does Dev Tools > Application have an option to expressly allow on a temporary basis? I didn't see any.

If not, perhaps a feature request?  I'd +1 a checkbox for "Allow for LAN" next to the ones for 'Offline', 'Update on reload', and 'Bypass for network' - or even an expressly entered domain.

Thank you in advance.

PhistucK

unread,
Apr 2, 2018, 11:47:19 AM4/2/18
to Google Chrome Developer Tools
I do not think there is such a Developer Tools feature.
However, there is a command line flag for treating an insecure origin as secure -


PhistucK

--
You received this message because you are subscribed to the Google Groups "Chrome DevTools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-developer-tools+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/b46f4826-35e7-4454-b995-ad26ef8de1ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tim Bradley

unread,
Apr 3, 2018, 3:19:15 AM4/3/18
to Chrome DevTools
Thanks @PhistucK

Your response is appreciated - I'll look into that.

Regards

Tim

Kayce Basques

unread,
Apr 18, 2018, 11:36:28 AM4/18/18
to Chrome DevTools
SWs must run on secure origins. localhost is treated as an exception. Maybe you can map your local server to localhost?

My hunch is that there's nothing DevTools can do to override this, without significant engineering effort.

Kayce Basques

unread,
Apr 19, 2018, 12:41:21 PM4/19/18
to Chrome DevTools
I just stumbled upon this command line flag: --unsafely-treat-insecure-origin-as-secure

Try launching Chrome with that flag. Might be a workaround for your use case.

Of course, the name says it all... when you use this flag, you're disabling browser security, so only use it you understand the risks.
Reply all
Reply to author
Forward
0 new messages