From e4d1fe2675abe58af6335ee813ac7232d55a38c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?RD1=20Tyrone=20=E8=91=89=E6=BE=A4=E7=A5=A5=20295?= Date: Thu, 28 May 2026 08:34:55 +0800 Subject: [PATCH 1/2] Fix markdown download cancellation logic --- src/ui/main/serverView/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ui/main/serverView/index.ts b/src/ui/main/serverView/index.ts index 806bb1968f..819ce410e4 100644 --- a/src/ui/main/serverView/index.ts +++ b/src/ui/main/serverView/index.ts @@ -176,6 +176,7 @@ const initializeServerWebContentsAfterAttach = ( webviewSession.on('will-download', (_event, item) => { if (item.getFilename().endsWith('.md')) { const downloadUrl = item.getURL(); + if (!downloadUrl.endsWith('download=')) return; item.cancel(); dispatch({ type: SERVER_DOCUMENT_VIEWER_OPEN_URL, From 572781d1d53f30aa685a01bdb122e8d962b4202c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?RD1=20Tyrone=20=E8=91=89=E6=BE=A4=E7=A5=A5=20295?= Date: Thu, 28 May 2026 08:49:44 +0800 Subject: [PATCH 2/2] Fix markdown download interception to only apply to viewer URLs --- src/ui/main/serverView/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ui/main/serverView/index.ts b/src/ui/main/serverView/index.ts index 819ce410e4..0b8980fbb4 100644 --- a/src/ui/main/serverView/index.ts +++ b/src/ui/main/serverView/index.ts @@ -176,6 +176,8 @@ const initializeServerWebContentsAfterAttach = ( webviewSession.on('will-download', (_event, item) => { if (item.getFilename().endsWith('.md')) { const downloadUrl = item.getURL(); + // Only intercept for viewer URLs; allow normal downloads to proceed. + // Rocket.Chat server appends 'download=' for view actions vs. download actions. if (!downloadUrl.endsWith('download=')) return; item.cancel(); dispatch({