Sha256: ec3e54dce969dc36d356ec28fe6c874c18e143f84f6efa47f06d99b16814c8a3
Contents?: true
Size: 722 Bytes
Versions: 13
Compression:
Stored size: 722 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 does not support service workers 🤷♀️"); } });
Version data entries
13 entries across 13 versions & 1 rubygems