mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
This commit is contained in:
parent
9c512960bc
commit
a440d3768c
1 changed files with 5 additions and 1 deletions
|
|
@ -1221,9 +1221,13 @@ app.on("activate", () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 在编辑器内打开链接的处理,比如 iframe 上的打开链接。
|
|
||||||
app.on("web-contents-created", (webContentsCreatedEvent, contents) => {
|
app.on("web-contents-created", (webContentsCreatedEvent, contents) => {
|
||||||
contents.setWindowOpenHandler((details) => {
|
contents.setWindowOpenHandler((details) => {
|
||||||
|
// https://github.com/siyuan-note/siyuan/issues/10567
|
||||||
|
if (details.url.startsWith("file:///") && details.disposition === "foreground-tab") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 在编辑器内打开链接的处理,比如 iframe 上的打开链接。
|
||||||
shell.openExternal(details.url);
|
shell.openExternal(details.url);
|
||||||
return {action: "deny"};
|
return {action: "deny"};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue