diff --git a/app/assets/javascripts/discourse/initializers/register-service-worker.js.es6 b/app/assets/javascripts/discourse/initializers/register-service-worker.js.es6 index 26d19206ffe..52838c2ed45 100644 --- a/app/assets/javascripts/discourse/initializers/register-service-worker.js.es6 +++ b/app/assets/javascripts/discourse/initializers/register-service-worker.js.es6 @@ -7,10 +7,17 @@ export default { location.hostname === "localhost"; const isSupported = isSecured && "serviceWorker" in navigator; - const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); if (isSupported) { - if (Discourse.ServiceWorkerURL && !isSafari) { + const isSafari = /^((?!chrome|android).)*safari/i.test( + navigator.userAgent + ); + + const disableServiceWorker = window.location.search.includes( + "disable_service_worker" + ); + + if (Discourse.ServiceWorkerURL && !isSafari && !disableServiceWorker) { navigator.serviceWorker.getRegistrations().then(registrations => { for (let registration of registrations) { if (