diff --git a/src/.vuepress/config.js b/src/.vuepress/config.js index 97d8082e..b5babf91 100644 --- a/src/.vuepress/config.js +++ b/src/.vuepress/config.js @@ -18,6 +18,7 @@ module.exports = { // Custom headers ["link", { rel: "preconnect", href: "https://fonts.gstatic.com", crossorigin:""}], ["link", { rel: "stylesheet", href: "https://fonts.googleapis.com/css?family=Open+Sans"}], + ["script", {src: "/scripts/remove_service_worker.js"}] ], themeConfig: { diff --git a/src/.vuepress/public/scripts/remove_service_worker.js b/src/.vuepress/public/scripts/remove_service_worker.js new file mode 100644 index 00000000..9257ba90 --- /dev/null +++ b/src/.vuepress/public/scripts/remove_service_worker.js @@ -0,0 +1,13 @@ +if ("serviceWorker" in navigator) { + console.log("Checking for service worker..."); + navigator.serviceWorker.getRegistrations().then(function (registrations) { + if (registrations.length < 1) { + console.log("Found no service worker!"); + return; + } + registrations.forEach((registration) => { + registration.unregister(); + console.log("Removed service worker!"); + }); + }); +}