dismiss Obsidian's quit overlay when window.close is blocked

This commit is contained in:
Nystik
2026-06-16 21:04:08 +02:00
parent 85956dbb3f
commit 201607dbea

View File

@@ -73,6 +73,15 @@ function installBuffer() {
function installWindowClose() {
window.close = function () {
console.log("[ignis] window.close() blocked");
// Obsidian's quit flow shows the progress overlay, awaits its pending save work, then calls window.close().
// Since we don't actually want to close the window, we clean up the progress state instead.
if (document.body.classList.contains("in-progress")) {
document.querySelector(".progress-bar-container")?.remove();
document.body.classList.remove("in-progress");
return;
}
if (!window.__vaultConfig) {
showVaultManager();
}