From 0deb31c49da5d4d992b9031f706f8771ac47bb64 Mon Sep 17 00:00:00 2001 From: xiaozzzi <42293085+xiaozzzi@users.noreply.github.com> Date: Fri, 5 Apr 2024 17:44:20 +0800 Subject: [PATCH] =?UTF-8?q?pref:=20=E5=88=A0=E9=99=A4=20will-navigate=20?= =?UTF-8?q?=E7=9B=91=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blossom-editor/src/main/index.ts | 38 ++++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/blossom-editor/src/main/index.ts b/blossom-editor/src/main/index.ts index 1f559876d..690f1ea2b 100644 --- a/blossom-editor/src/main/index.ts +++ b/blossom-editor/src/main/index.ts @@ -432,9 +432,9 @@ export const initOnWindow = (window: BrowserWindow) => { /** * 拦截页面链接 */ - window.webContents.on('will-navigate', (event: Event, url: string) => { - interceptorATag(event, url) - }) + // window.webContents.on('will-navigate', (event: Event, url: string) => { + // interceptorATag(event, url) + // }) /** * 打开链接, 如果打开链接于服务器域名相同, 则在新窗口中打开 @@ -451,19 +451,19 @@ export const initOnWindow = (window: BrowserWindow) => { }) } -/** - * 拦截 a 标签 - * @param e - * @param url - */ -const interceptorATag = (e: Event, url: string): boolean => { - e.preventDefault() - let innerUrl = url - if (blossomUserinfo && innerUrl.startsWith(blossomUserinfo.userParams.WEB_ARTICLE_URL)) { - let articleId: string = innerUrl.replaceAll(blossomUserinfo.userParams.WEB_ARTICLE_URL, '') - createNewWindow('article', articleId, Number(articleId)) - } else if (!is.dev) { - shell.openExternal(url) - } - return true -} +// /** +// * 拦截 a 标签 +// * @param e +// * @param url +// */ +// const interceptorATag = (e: Event, url: string): boolean => { +// e.preventDefault() +// let innerUrl = url +// if (blossomUserinfo && innerUrl.startsWith(blossomUserinfo.userParams.WEB_ARTICLE_URL)) { +// let articleId: string = innerUrl.replaceAll(blossomUserinfo.userParams.WEB_ARTICLE_URL, '') +// createNewWindow('article', articleId, Number(articleId)) +// } else if (!is.dev) { +// shell.openExternal(url) +// } +// return true +// }