mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20: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);
|
Menu.setApplicationMenu(menu);
|
||||||
// 当前页面链接使用浏览器打开
|
// 当前页面链接使用浏览器打开
|
||||||
currentWindow.webContents.on("will-navigate", (event, url) => {
|
currentWindow.webContents.on("will-navigate", (event, url) => {
|
||||||
const currentURL = new URL(event.sender.getURL());
|
if (event.sender) {
|
||||||
if (url.startsWith(getServer(currentURL.port))) {
|
const currentURL = new URL(event.sender.getURL());
|
||||||
|
if (url.startsWith(getServer(currentURL.port))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
shell.openExternal(url);
|
shell.openExternal(url);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
currentWindow.on("close", (event) => {
|
currentWindow.on("close", (event) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue