Unfortunately, refreshing the page in offline mode forces the browser to load the offline.html file because the Mendix runtime cannot reload the app without a network connection.
Disable Browser Refresh
Intercept refresh behavior by adding a beforeunload event handler in JavaScript. This prevents page reload when offline.
JS:
window.addEventListener('beforeunload', (event) => {
if (!navigator.onLine) {
event.preventDefault();
event.returnValue = '';
}
});
Other option could be, Instead of loading offline.html, redirect users to an in-app "Offline Mode" page using a Service Worker or custom routing logic.