From c877c73528c26b0cfb8e411c769fa2b46b6ea30f Mon Sep 17 00:00:00 2001 From: jeasonnow Date: Wed, 26 Jul 2023 15:23:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A2=9E=E5=8A=A0=E9=92=88=E5=AF=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=88=9B=E5=BB=BA=20a=20=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E5=85=B6=E4=BB=96=E9=A1=B5=E9=9D=A2=E9=87=8D?= =?UTF-8?q?=E5=AE=9A=E5=90=91=E4=B8=8B=E8=BD=BD=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/src/inject/event.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src-tauri/src/inject/event.js b/src-tauri/src/inject/event.js index 55622fd..71ecc13 100644 --- a/src-tauri/src/inject/event.js +++ b/src-tauri/src/inject/event.js @@ -134,7 +134,7 @@ function detectDownloadByCreateAnchor() { const anchorEle = createEle.call(document, el); // use addEventListener to avoid overriding the original click event. - anchorEle.addEventListener('click', () => { + anchorEle.addEventListener('click', (e) => { const url = anchorEle.href; const filename = anchorEle.download || getFilenameFromUrl(url); if (window.blobToUrlCaches.has(url)) { @@ -142,6 +142,8 @@ function detectDownloadByCreateAnchor() { // case: downoload from dataURL -> convert dataURL -> } else if (url.startsWith('data:')) { downladFromDataUri(url, filename); + } else { + handleExternalLink(e, url); } }, true); @@ -150,12 +152,6 @@ function detectDownloadByCreateAnchor() { } - domEl.addEventListener('mousedown', (e) => { - e.preventDefault(); - if (e.buttons === 1 && e.detail !== 2) { - appWindow.startDragging().then(); - } - }); domEl.addEventListener('touchstart', () => { appWindow.startDragging().then();