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

Version Path
decidim-core-0.29.1 app/packs/src/decidim/sw/loader.js
decidim-core-0.28.4 app/packs/src/decidim/sw/loader.js
decidim-core-0.29.0 app/packs/src/decidim/sw/loader.js
decidim-core-0.28.3 app/packs/src/decidim/sw/loader.js
decidim-core-0.29.0.rc4 app/packs/src/decidim/sw/loader.js
decidim-core-0.29.0.rc3 app/packs/src/decidim/sw/loader.js
decidim-core-0.29.0.rc2 app/packs/src/decidim/sw/loader.js
decidim-core-0.29.0.rc1 app/packs/src/decidim/sw/loader.js
decidim-core-0.28.2 app/packs/src/decidim/sw/loader.js
decidim-core-0.28.1 app/packs/src/decidim/sw/loader.js
decidim-core-0.28.0 app/packs/src/decidim/sw/loader.js
decidim-core-0.28.0.rc5 app/packs/src/decidim/sw/loader.js
decidim-core-0.28.0.rc4 app/packs/src/decidim/sw/loader.js