Currently https is always enforced when registering the Service Worker (see here), however, http is allowed on localhost according to this page:
During development you'll be able to use service worker through localhost, but to deploy it on a site you'll need to have HTTPS setup on your server.
When developing on localhost without using https the Service Worker is not registered and an error shown in console instead, for example:

Perhaps we should consider registering the Service Worker without enforcing the https in case of localhost to make it easier for developers using http locally on localhost.
Currently
httpsis always enforced when registering the Service Worker (see here), however,httpis allowed onlocalhostaccording to this page:When developing on

localhostwithout usinghttpsthe Service Worker is not registered and an error shown in console instead, for example:Perhaps we should consider registering the Service Worker without enforcing the
httpsin case oflocalhostto make it easier for developers usinghttplocally onlocalhost.