From b2bfabb6dcb9b2781279a0de3d1d000009cf774e Mon Sep 17 00:00:00 2001 From: Tw93 Date: Fri, 18 Aug 2023 21:22:37 +0800 Subject: [PATCH] :bug: Fix the issue of address redirection opening a new window. --- src-tauri/src/inject/event.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src-tauri/src/inject/event.js b/src-tauri/src/inject/event.js index f237483..dbea191 100644 --- a/src-tauri/src/inject/event.js +++ b/src-tauri/src/inject/event.js @@ -59,7 +59,7 @@ function externalTargetLink() { } function externalSelfLink() { - return ['twitter.com', 'www.zhihu.com'].indexOf(location.hostname) > -1; + return ['chat.openai.com'].indexOf(location.hostname) > -1; } document.addEventListener('DOMContentLoaded', () => { @@ -170,7 +170,7 @@ document.addEventListener('DOMContentLoaded', () => { // case: download from dataURL -> convert dataURL -> } else if (url.startsWith('data:')) { downloadFromDataUri(url, filename); - } else if (!externalSelfLink()) { + } else if (isDownloadLink(url) || externalSelfLink()) { handleExternalLink(e, url); } }, true);