Skip to content

Commit

Permalink
Do not block app exit in Electron or NWJS
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaifroid committed Oct 26, 2024
1 parent 64b6ed8 commit 6830e97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion www/js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ window.onerror = function (msg, url, line, col, error) {

// Set a beforeUnload handler to prevent app reloads without confirmation if a ZIM file is loaded
window.addEventListener('beforeunload', function (event) {
if (appstate && appstate.selectedArchive && params.appCache) {
if (appstate && appstate.selectedArchive && params.appCache && !/Electron/.test(params.appType)) {
var confirmationMessage = 'Warning: you may have to reload the ZIM archive if you leave this page!';
event.preventDefault();
// Included for legacy support, e.g. Chrome/Edge < 119
Expand Down

0 comments on commit 6830e97

Please sign in to comment.