mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-07-03 14:09:06 +02:00
Update main.js (#7956)
This commit is contained in:
@@ -357,13 +357,15 @@ const boot = () => {
|
||||
Menu.setApplicationMenu(menu);
|
||||
// 当前页面链接使用浏览器打开
|
||||
currentWindow.webContents.on("will-navigate", (event, url) => {
|
||||
const currentURL = new URL(event.sender.getURL());
|
||||
if (url.startsWith(getServer(currentURL.port))) {
|
||||
if (event.sender) {
|
||||
const currentURL = new URL(event.sender.getURL());
|
||||
if (url.startsWith(getServer(currentURL.port))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
shell.openExternal(url);
|
||||
event.preventDefault();
|
||||
shell.openExternal(url);
|
||||
}
|
||||
});
|
||||
|
||||
currentWindow.on("close", (event) => {
|
||||
|
||||
Reference in New Issue
Block a user