mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
Update main.js (#7956)
This commit is contained in:
parent
1cc2a66714
commit
ab5bfe2aaa
1 changed files with 7 additions and 5 deletions
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue