Localhost and secure contexts
Browsers can treat localhost and .localhost names as secure contexts over HTTP when they guarantee loopback resolution. This lets local pages use browser APIs that require a secure context without a TLS certificate. See the W3C Secure Contexts draft.
Secure context does not mean HTTPS. Browser permissions and CORS still apply, and HTTP backend connections remain unencrypted.
