From 755d423e593909d2aad4d36f255106e9ca38cada Mon Sep 17 00:00:00 2001
From: Manuel <5673677+mtrezza@users.noreply.github.com>
Date: Thu, 17 Jul 2025 15:15:13 +0200
Subject: [PATCH 01/10] fix: dashboard reloads when opening in new tab
---
Parse-Dashboard/public/sw.js | 23 +++++++++++++++++++++++
src/dashboard/index.js | 2 ++
src/login/index.js | 2 ++
src/registerServiceWorker.js | 8 ++++++++
4 files changed, 35 insertions(+)
create mode 100644 Parse-Dashboard/public/sw.js
create mode 100644 src/registerServiceWorker.js
diff --git a/Parse-Dashboard/public/sw.js b/Parse-Dashboard/public/sw.js
new file mode 100644
index 0000000000..00bd98acb2
--- /dev/null
+++ b/Parse-Dashboard/public/sw.js
@@ -0,0 +1,23 @@
+const CACHE_NAME = 'dashboard-cache-v1';
+
+self.addEventListener('install', () => {
+ self.skipWaiting();
+});
+
+self.addEventListener('fetch', event => {
+ const req = event.request;
+ if (req.destination === 'script' || req.destination === 'style' || req.url.includes('/bundles/')) {
+ event.respondWith(
+ caches.match(req).then(cached => {
+ return (
+ cached ||
+ fetch(req).then(resp => {
+ const resClone = resp.clone();
+ caches.open(CACHE_NAME).then(cache => cache.put(req, resClone));
+ return resp;
+ })
+ );
+ })
+ );
+ }
+});
diff --git a/src/dashboard/index.js b/src/dashboard/index.js
index 539e71d8c3..8336cde9ae 100644
--- a/src/dashboard/index.js
+++ b/src/dashboard/index.js
@@ -12,6 +12,7 @@ import installDevTools from 'immutable-devtools';
import React from 'react';
import ReactDOM from 'react-dom';
import Dashboard from './Dashboard';
+import registerServiceWorker from '../registerServiceWorker';
require('stylesheets/fonts.scss');
require('graphiql/graphiql.min.css');
@@ -19,3 +20,4 @@ installDevTools(Immutable);
const path = window.PARSE_DASHBOARD_PATH || '/';
ReactDOM.render(, document.getElementById('browser_mount'));
+registerServiceWorker();
diff --git a/src/login/index.js b/src/login/index.js
index d81494fcfe..aaed8af945 100644
--- a/src/login/index.js
+++ b/src/login/index.js
@@ -8,6 +8,7 @@
import Login from './Login';
import React from 'react';
import ReactDOM from 'react-dom';
+import registerServiceWorker from '../registerServiceWorker';
require('stylesheets/fonts.scss');
@@ -15,3 +16,4 @@ require('stylesheets/fonts.scss');
const path = window.PARSE_DASHBOARD_PATH || '/';
ReactDOM.render(, document.getElementById('login_mount'));
+registerServiceWorker();
diff --git a/src/registerServiceWorker.js b/src/registerServiceWorker.js
new file mode 100644
index 0000000000..13fa97320a
--- /dev/null
+++ b/src/registerServiceWorker.js
@@ -0,0 +1,8 @@
+export default function registerServiceWorker() {
+ if ('serviceWorker' in navigator) {
+ window.addEventListener('load', () => {
+ const swPath = `${window.PARSE_DASHBOARD_PATH || '/'}sw.js`;
+ navigator.serviceWorker.register(swPath).catch(() => {});
+ });
+ }
+}
From 63bb63ad9c33d22124094a156ec74c3e5ce71481 Mon Sep 17 00:00:00 2001
From: Manuel <5673677+mtrezza@users.noreply.github.com>
Date: Fri, 18 Jul 2025 10:08:43 +0200
Subject: [PATCH 02/10] feat: optionally cache dashboard resources
---
Parse-Dashboard/app.js | 6 ++++++
Parse-Dashboard/parse-dashboard-config.json | 3 ++-
README.md | 22 +++++++++++++++++++++
src/registerServiceWorker.js | 3 +++
4 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/Parse-Dashboard/app.js b/Parse-Dashboard/app.js
index e47994e086..301a7f9b2a 100644
--- a/Parse-Dashboard/app.js
+++ b/Parse-Dashboard/app.js
@@ -219,6 +219,9 @@ module.exports = function(config, options) {
Parse Dashboard
@@ -251,6 +254,9 @@ module.exports = function(config, options) {
Parse Dashboard
diff --git a/Parse-Dashboard/parse-dashboard-config.json b/Parse-Dashboard/parse-dashboard-config.json
index 84d5d15396..59609b09c9 100644
--- a/Parse-Dashboard/parse-dashboard-config.json
+++ b/Parse-Dashboard/parse-dashboard-config.json
@@ -10,5 +10,6 @@
"secondaryBackgroundColor": ""
}
],
- "iconsFolder": "icons"
+ "iconsFolder": "icons",
+ "enableBrowserServiceWorker": false
}
diff --git a/README.md b/README.md
index 080e3c00cd..aada25229c 100644
--- a/README.md
+++ b/README.md
@@ -43,6 +43,7 @@ Parse Dashboard is a standalone dashboard for managing your [Parse Server](https
- [Custom order in the filter popup](#custom-order-in-the-filter-popup)
- [Persistent Filters](#persistent-filters)
- [Scripts](#scripts)
+ - [Browser Service Worker](#browser-service-worker)
- [Running as Express Middleware](#running-as-express-middleware)
- [Deploying Parse Dashboard](#deploying-parse-dashboard)
- [Preparing for Deployment](#preparing-for-deployment)
@@ -510,6 +511,27 @@ Parse.Cloud.define('deleteAccount', async (req) => {
+### Browser Service Worker
+
+Parse Dashboard can cache its bundles in the browser so that opening the dashboard in another tab does not reload the resources.
+Enable this feature with `enableBrowserServiceWorker`:
+
+```javascript
+const dashboard = new ParseDashboard({
+ enableBrowserServiceWorker: true,
+ apps: [
+ {
+ serverURL: 'http://localhost:1337/parse',
+ appId: 'myAppId',
+ masterKey: 'myMasterKey',
+ appName: 'MyApp'
+ }
+ ]
+});
+```
+
+The service worker is disabled by default.
+
# Running as Express Middleware
Instead of starting Parse Dashboard with the CLI, you can also run it as an [express](https://github.com/expressjs/express) middleware.
diff --git a/src/registerServiceWorker.js b/src/registerServiceWorker.js
index 13fa97320a..a163346743 100644
--- a/src/registerServiceWorker.js
+++ b/src/registerServiceWorker.js
@@ -1,4 +1,7 @@
export default function registerServiceWorker() {
+ if (!window.PARSE_DASHBOARD_ENABLE_SERVICE_WORKER) {
+ return;
+ }
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
const swPath = `${window.PARSE_DASHBOARD_PATH || '/'}sw.js`;
From 00b536805ef0c1c243f896f31cf4b83562650903 Mon Sep 17 00:00:00 2001
From: Manuel <5673677+mtrezza@users.noreply.github.com>
Date: Fri, 18 Jul 2025 14:32:17 +0200
Subject: [PATCH 03/10] fix: service worker persists after closing tabs
---
Parse-Dashboard/public/sw.js | 10 +++++++++
README.md | 1 +
src/registerServiceWorker.js | 40 +++++++++++++++++++++++++++++++-----
3 files changed, 46 insertions(+), 5 deletions(-)
diff --git a/Parse-Dashboard/public/sw.js b/Parse-Dashboard/public/sw.js
index 00bd98acb2..829359e646 100644
--- a/Parse-Dashboard/public/sw.js
+++ b/Parse-Dashboard/public/sw.js
@@ -4,6 +4,10 @@ self.addEventListener('install', () => {
self.skipWaiting();
});
+self.addEventListener('activate', event => {
+ event.waitUntil(self.clients.claim());
+});
+
self.addEventListener('fetch', event => {
const req = event.request;
if (req.destination === 'script' || req.destination === 'style' || req.url.includes('/bundles/')) {
@@ -21,3 +25,9 @@ self.addEventListener('fetch', event => {
);
}
});
+
+self.addEventListener('message', event => {
+ if (event.data === 'unregister') {
+ self.registration.unregister();
+ }
+});
diff --git a/README.md b/README.md
index aada25229c..46f012e12e 100644
--- a/README.md
+++ b/README.md
@@ -531,6 +531,7 @@ const dashboard = new ParseDashboard({
```
The service worker is disabled by default.
+It automatically unregisters when all dashboard tabs are closed, ensuring updates load without manual intervention.
# Running as Express Middleware
diff --git a/src/registerServiceWorker.js b/src/registerServiceWorker.js
index a163346743..4470830228 100644
--- a/src/registerServiceWorker.js
+++ b/src/registerServiceWorker.js
@@ -2,10 +2,40 @@ export default function registerServiceWorker() {
if (!window.PARSE_DASHBOARD_ENABLE_SERVICE_WORKER) {
return;
}
- if ('serviceWorker' in navigator) {
- window.addEventListener('load', () => {
- const swPath = `${window.PARSE_DASHBOARD_PATH || '/'}sw.js`;
- navigator.serviceWorker.register(swPath).catch(() => {});
- });
+ if (!('serviceWorker' in navigator)) {
+ return;
}
+
+ const mountPath = window.PARSE_DASHBOARD_PATH || '/';
+ const swPath = `${mountPath}sw.js`;
+ const countKey = `pd-sw-tabs:${mountPath}`;
+
+ const increment = () => {
+ const current = parseInt(localStorage.getItem(countKey) || '0', 10);
+ localStorage.setItem(countKey, String(current + 1));
+ };
+
+ const decrement = () => {
+ const current = parseInt(localStorage.getItem(countKey) || '0', 10);
+ const next = Math.max(0, current - 1);
+ localStorage.setItem(countKey, String(next));
+ if (next === 0) {
+ if (navigator.serviceWorker.controller) {
+ navigator.serviceWorker.controller.postMessage('unregister');
+ }
+ navigator.serviceWorker.getRegistration(swPath).then(reg => {
+ if (reg) {
+ reg.unregister();
+ }
+ });
+ caches.keys().then(keys => keys.forEach(k => caches.delete(k)));
+ }
+ };
+
+ increment();
+ window.addEventListener('beforeunload', decrement);
+
+ window.addEventListener('load', () => {
+ navigator.serviceWorker.register(swPath).catch(() => {});
+ });
}
From f219c371ff013f3961a8f44f6a06dc984ea05692 Mon Sep 17 00:00:00 2001
From: Manuel <5673677+mtrezza@users.noreply.github.com>
Date: Fri, 18 Jul 2025 15:06:39 +0200
Subject: [PATCH 04/10] fix: prevent stale tab count from blocking sw
unregister
---
src/registerServiceWorker.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/registerServiceWorker.js b/src/registerServiceWorker.js
index 4470830228..79a9eaabc7 100644
--- a/src/registerServiceWorker.js
+++ b/src/registerServiceWorker.js
@@ -11,7 +11,10 @@ export default function registerServiceWorker() {
const countKey = `pd-sw-tabs:${mountPath}`;
const increment = () => {
- const current = parseInt(localStorage.getItem(countKey) || '0', 10);
+ let current = parseInt(localStorage.getItem(countKey) || '0', 10);
+ if (!navigator.serviceWorker.controller && current > 0) {
+ current = 0;
+ }
localStorage.setItem(countKey, String(current + 1));
};
@@ -34,6 +37,7 @@ export default function registerServiceWorker() {
increment();
window.addEventListener('beforeunload', decrement);
+ window.addEventListener('pagehide', decrement);
window.addEventListener('load', () => {
navigator.serviceWorker.register(swPath).catch(() => {});
From 63f04df3d54656a8d89abeb9ff4aad4ad7925160 Mon Sep 17 00:00:00 2001
From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com>
Date: Fri, 18 Jul 2025 15:37:00 +0200
Subject: [PATCH 05/10] fix
---
src/login/index.js | 2 --
src/registerServiceWorker.js | 28 ++++++++++++++++++++++++----
2 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/src/login/index.js b/src/login/index.js
index aaed8af945..d81494fcfe 100644
--- a/src/login/index.js
+++ b/src/login/index.js
@@ -8,7 +8,6 @@
import Login from './Login';
import React from 'react';
import ReactDOM from 'react-dom';
-import registerServiceWorker from '../registerServiceWorker';
require('stylesheets/fonts.scss');
@@ -16,4 +15,3 @@ require('stylesheets/fonts.scss');
const path = window.PARSE_DASHBOARD_PATH || '/';
ReactDOM.render(, document.getElementById('login_mount'));
-registerServiceWorker();
diff --git a/src/registerServiceWorker.js b/src/registerServiceWorker.js
index 79a9eaabc7..ae647d01b5 100644
--- a/src/registerServiceWorker.js
+++ b/src/registerServiceWorker.js
@@ -1,4 +1,5 @@
-export default function registerServiceWorker() {
+function registerServiceWorker() {
+
if (!window.PARSE_DASHBOARD_ENABLE_SERVICE_WORKER) {
return;
}
@@ -10,6 +11,16 @@ export default function registerServiceWorker() {
const swPath = `${mountPath}sw.js`;
const countKey = `pd-sw-tabs:${mountPath}`;
+ /**
+ * Registers the service worker at the specified path.
+ */
+ const register = () => {
+ navigator.serviceWorker.register(swPath).catch(() => {});
+ };
+
+ /**
+ * Increments the count of open dashboard tabs in localStorage.
+ */
const increment = () => {
let current = parseInt(localStorage.getItem(countKey) || '0', 10);
if (!navigator.serviceWorker.controller && current > 0) {
@@ -18,6 +29,9 @@ export default function registerServiceWorker() {
localStorage.setItem(countKey, String(current + 1));
};
+ /**
+ * Decrements the count of open dashboard tabs in localStorage.
+ */
const decrement = () => {
const current = parseInt(localStorage.getItem(countKey) || '0', 10);
const next = Math.max(0, current - 1);
@@ -36,10 +50,16 @@ export default function registerServiceWorker() {
};
increment();
- window.addEventListener('beforeunload', decrement);
- window.addEventListener('pagehide', decrement);
window.addEventListener('load', () => {
- navigator.serviceWorker.register(swPath).catch(() => {});
+ register();
+ });
+ window.addEventListener('beforeunload', () => {
+ decrement();
+ });
+ window.addEventListener('pagehide', () => {
+ decrement();
});
}
+
+export default registerServiceWorker;
From 0c306b1f04e4561f0c12f7c60525588e1895fc73 Mon Sep 17 00:00:00 2001
From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com>
Date: Fri, 18 Jul 2025 16:00:13 +0200
Subject: [PATCH 06/10] Update README.md
---
README.md | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 46f012e12e..fd15787b39 100644
--- a/README.md
+++ b/README.md
@@ -513,8 +513,14 @@ Parse.Cloud.define('deleteAccount', async (req) => {
### Browser Service Worker
-Parse Dashboard can cache its bundles in the browser so that opening the dashboard in another tab does not reload the resources.
-Enable this feature with `enableBrowserServiceWorker`:
+Parse Dashboard can cache its resources such as bundles in the browser, so that opening the dashboard in another tab does not reload the dashboard resources from the server but from the local browser cache. Caching only starts after login in the dashboard.
+
+| Parameter | Type | Optional | Default | Example | Description |
+|------------------------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------------------------------------|
+| `enableBrowserServiceWorker` | Boolean | yes | `false` | `true` | Enables the browser service worker to cache dashboard resources in the browser for faster dashboard loading in additional browser tabs. |
+
+
+Example configuration:
```javascript
const dashboard = new ParseDashboard({
@@ -530,8 +536,8 @@ const dashboard = new ParseDashboard({
});
```
-The service worker is disabled by default.
-It automatically unregisters when all dashboard tabs are closed, ensuring updates load without manual intervention.
+> [!Warning]
+> Enabling this feature will start a browser service worker that caches dashboard resources locally only once. As long as the service worker is running, it will prevent loading any dashboard updates from the server, even if the user reloads the browser tab. The service worker is automatically stopped, once the last dashboard browser tab is closed. On the opening of the first dashboard browser tab, the dashboard resources are again loaded from the server and a new service worker is started.
# Running as Express Middleware
From cb5472022389669b9b196fc25e58c863fa8294f0 Mon Sep 17 00:00:00 2001
From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com>
Date: Fri, 18 Jul 2025 16:17:40 +0200
Subject: [PATCH 07/10] rename config
---
Parse-Dashboard/app.js | 8 ++++----
README.md | 13 ++++++++-----
src/registerServiceWorker.js | 2 +-
3 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/Parse-Dashboard/app.js b/Parse-Dashboard/app.js
index 301a7f9b2a..3aba1923b4 100644
--- a/Parse-Dashboard/app.js
+++ b/Parse-Dashboard/app.js
@@ -219,8 +219,8 @@ module.exports = function(config, options) {
Parse Dashboard
@@ -254,8 +254,8 @@ module.exports = function(config, options) {
Parse Dashboard
diff --git a/README.md b/README.md
index fd15787b39..37bc1f71ad 100644
--- a/README.md
+++ b/README.md
@@ -515,16 +515,16 @@ Parse.Cloud.define('deleteAccount', async (req) => {
Parse Dashboard can cache its resources such as bundles in the browser, so that opening the dashboard in another tab does not reload the dashboard resources from the server but from the local browser cache. Caching only starts after login in the dashboard.
-| Parameter | Type | Optional | Default | Example | Description |
-|------------------------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------------------------------------|
-| `enableBrowserServiceWorker` | Boolean | yes | `false` | `true` | Enables the browser service worker to cache dashboard resources in the browser for faster dashboard loading in additional browser tabs. |
+| Parameter | Type | Optional | Default | Example | Description |
+|-----------------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------------------------------------|
+| `enableResourceCache` | Boolean | yes | `false` | `true` | Enables caching of dashboard resources in the browser for faster dashboard loading in additional browser tabs. |
Example configuration:
```javascript
const dashboard = new ParseDashboard({
- enableBrowserServiceWorker: true,
+ enableResourceCache: true,
apps: [
{
serverURL: 'http://localhost:1337/parse',
@@ -537,7 +537,10 @@ const dashboard = new ParseDashboard({
```
> [!Warning]
-> Enabling this feature will start a browser service worker that caches dashboard resources locally only once. As long as the service worker is running, it will prevent loading any dashboard updates from the server, even if the user reloads the browser tab. The service worker is automatically stopped, once the last dashboard browser tab is closed. On the opening of the first dashboard browser tab, the dashboard resources are again loaded from the server and a new service worker is started.
+> This feature can make it more difficult to push dashboard updates to users. Enabling the resource cache will start a browser service worker that caches dashboard resources locally only once. As long as the service worker is running, it will prevent loading any dashboard updates from the server, even if the user reloads the browser tab. The service worker is automatically stopped, once the last dashboard browser tab is closed. On the opening of the first dashboard browser tab, a new service worker is started and the dashboard resources are loaded from the server.
+
+> [!Note]
+> For developers: during dashboard development, the resource cache should be disabled to ensure reloading the dashboard tab in the browser loads the new dashboard bundle with any changes you made in the source code. You can inspect the service worker in the developer tools of most browsers. For example in Google Chrome, go to *Developer Tools > Application tab > Service workers* to see whether the dashboard service worker is currently running and to debug it. Updates to the service worker source code in `src/registerServiceWorker.js` requires to restart `npm run dev` as it is not part of the dashboard bundle but the environment in which the bundle is mounted.
# Running as Express Middleware
diff --git a/src/registerServiceWorker.js b/src/registerServiceWorker.js
index ae647d01b5..742f09a052 100644
--- a/src/registerServiceWorker.js
+++ b/src/registerServiceWorker.js
@@ -1,6 +1,6 @@
function registerServiceWorker() {
- if (!window.PARSE_DASHBOARD_ENABLE_SERVICE_WORKER) {
+ if (!window.PARSE_DASHBOARD_ENABLE_RESOURCE_CACHE) {
return;
}
if (!('serviceWorker' in navigator)) {
From df47ab712d64955b05304abbcbd6e0e2684172bd Mon Sep 17 00:00:00 2001
From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com>
Date: Fri, 18 Jul 2025 16:18:41 +0200
Subject: [PATCH 08/10] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 37bc1f71ad..d5bdcdea58 100644
--- a/README.md
+++ b/README.md
@@ -43,7 +43,7 @@ Parse Dashboard is a standalone dashboard for managing your [Parse Server](https
- [Custom order in the filter popup](#custom-order-in-the-filter-popup)
- [Persistent Filters](#persistent-filters)
- [Scripts](#scripts)
- - [Browser Service Worker](#browser-service-worker)
+ - [Resource Cache](#resource-cache)
- [Running as Express Middleware](#running-as-express-middleware)
- [Deploying Parse Dashboard](#deploying-parse-dashboard)
- [Preparing for Deployment](#preparing-for-deployment)
@@ -511,7 +511,7 @@ Parse.Cloud.define('deleteAccount', async (req) => {
-### Browser Service Worker
+### Resource Cache
Parse Dashboard can cache its resources such as bundles in the browser, so that opening the dashboard in another tab does not reload the dashboard resources from the server but from the local browser cache. Caching only starts after login in the dashboard.
From e1a8e66ffdebb7fea77a6910a2608a81d5cf063c Mon Sep 17 00:00:00 2001
From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com>
Date: Fri, 18 Jul 2025 16:30:32 +0200
Subject: [PATCH 09/10] fixes
---
Parse-Dashboard/public/sw.js | 15 ++++++++++++++-
src/registerServiceWorker.js | 2 +-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/Parse-Dashboard/public/sw.js b/Parse-Dashboard/public/sw.js
index 829359e646..6755261373 100644
--- a/Parse-Dashboard/public/sw.js
+++ b/Parse-Dashboard/public/sw.js
@@ -5,7 +5,20 @@ self.addEventListener('install', () => {
});
self.addEventListener('activate', event => {
- event.waitUntil(self.clients.claim());
+ event.waitUntil(
+ Promise.all([
+ self.clients.claim(),
+ caches.keys().then(cacheNames => {
+ return Promise.all(
+ cacheNames.map(cacheName => {
+ if (cacheName !== CACHE_NAME) {
+ return caches.delete(cacheName);
+ }
+ })
+ );
+ })
+ ])
+ );
});
self.addEventListener('fetch', event => {
diff --git a/src/registerServiceWorker.js b/src/registerServiceWorker.js
index 742f09a052..69f229c219 100644
--- a/src/registerServiceWorker.js
+++ b/src/registerServiceWorker.js
@@ -7,7 +7,7 @@ function registerServiceWorker() {
return;
}
- const mountPath = window.PARSE_DASHBOARD_PATH || '/';
+ const mountPath = (window.PARSE_DASHBOARD_PATH || '/').replace(/\/?$/, '/');
const swPath = `${mountPath}sw.js`;
const countKey = `pd-sw-tabs:${mountPath}`;
From 14dc9e7a93c87369c8833aa3eeb2fd589704491f Mon Sep 17 00:00:00 2001
From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com>
Date: Fri, 18 Jul 2025 16:55:09 +0200
Subject: [PATCH 10/10] fix
---
Parse-Dashboard/app.js | 7 +------
README.md | 2 +-
src/registerServiceWorker.js | 1 +
3 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/Parse-Dashboard/app.js b/Parse-Dashboard/app.js
index 3aba1923b4..72fc657333 100644
--- a/Parse-Dashboard/app.js
+++ b/Parse-Dashboard/app.js
@@ -219,9 +219,6 @@ module.exports = function(config, options) {
Parse Dashboard
@@ -254,9 +251,7 @@ module.exports = function(config, options) {
Parse Dashboard
diff --git a/README.md b/README.md
index d5bdcdea58..8b84e7a23c 100644
--- a/README.md
+++ b/README.md
@@ -540,7 +540,7 @@ const dashboard = new ParseDashboard({
> This feature can make it more difficult to push dashboard updates to users. Enabling the resource cache will start a browser service worker that caches dashboard resources locally only once. As long as the service worker is running, it will prevent loading any dashboard updates from the server, even if the user reloads the browser tab. The service worker is automatically stopped, once the last dashboard browser tab is closed. On the opening of the first dashboard browser tab, a new service worker is started and the dashboard resources are loaded from the server.
> [!Note]
-> For developers: during dashboard development, the resource cache should be disabled to ensure reloading the dashboard tab in the browser loads the new dashboard bundle with any changes you made in the source code. You can inspect the service worker in the developer tools of most browsers. For example in Google Chrome, go to *Developer Tools > Application tab > Service workers* to see whether the dashboard service worker is currently running and to debug it. Updates to the service worker source code in `src/registerServiceWorker.js` requires to restart `npm run dev` as it is not part of the dashboard bundle but the environment in which the bundle is mounted.
+> For developers: during dashboard development, the resource cache should be disabled to ensure reloading the dashboard tab in the browser loads the new dashboard bundle with any changes you made in the source code. You can inspect the service worker in the developer tools of most browsers. For example in Google Chrome, go to *Developer Tools > Application tab > Service workers* to see whether the dashboard service worker is currently running and to debug it.
# Running as Express Middleware
diff --git a/src/registerServiceWorker.js b/src/registerServiceWorker.js
index 69f229c219..99d42393ec 100644
--- a/src/registerServiceWorker.js
+++ b/src/registerServiceWorker.js
@@ -3,6 +3,7 @@ function registerServiceWorker() {
if (!window.PARSE_DASHBOARD_ENABLE_RESOURCE_CACHE) {
return;
}
+
if (!('serviceWorker' in navigator)) {
return;
}