Sha256: fdb417052ae61007f05f00ffbd9551522a856052888b1154eac1d98ba38924aa
Contents?: true
Size: 721 Bytes
Versions: 12
Compression:
Stored size: 721 Bytes
Contents
// check if the browser supports serviceWorker at all window.addEventListener("load", async () => { if ("serviceWorker" in navigator) { await navigator.serviceWorker.register("/sw.js", { scope: "/" }); const mandatoryElements = document.querySelector(".js-sw-mandatory"); // Opera uses Opera for versions <= 12 and OPR for versions > 12 const isOperaMini = ((navigator.userAgent.indexOf("OPR") > -1) || (navigator.userAgent.indexOf("Opera") > -1)) && (navigator.userAgent.indexOf("Mini") > -1); if (mandatoryElements && isOperaMini) { mandatoryElements.classList.add("hide") } } else { console.log("Your browser doesn't support service workers 🤷♀️"); } });
Version data entries
12 entries across 12 versions & 1 rubygems