A music player that connects to your cloud/distributed storage.
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

Detect secure context

+8 -4
+8 -4
src/Javascript/index.js
··· 25 25 location.href = location.href.replace("http://", "https://") 26 26 } 27 27 28 - // Service worker 29 - if ("serviceWorker" in navigator) { 28 + // Secure context & Service worker 29 + if (!self.isSecureContext) { 30 + failure(` 31 + This app only works on a <a class="underline" target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts#When_is_a_context_considered_secure">secure context</a>, HTTPS & localhost, and modern browsers. 32 + `) 33 + 34 + } else if ("serviceWorker" in navigator) { 30 35 navigator.serviceWorker.register("service-worker.js").then( 31 36 initialise, 32 37 () => failure( ··· 35 40 : "Failed to start the service worker, try using HTTPS." 36 41 ) 37 42 ) 38 - } else { 39 - failure("We'll need a more modern browser to liven the place up a bit.") 43 + 40 44 } 41 45 42 46