mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 01:40:40 +08:00

Currently, we check if the site is loaded over `https` before registering the service worker. This prevents the service worker from being registered in a standard dev/test setup. This change replaces the protocol check with `isSecureContext` property check. In addition to resources delivered over `https`, `isSecureContext` returns `true` for resources loaded over `http://127.0.0.1`, `http://localhost`, `http://*.localhost` and `file://`.