mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
🎨 iframe 使用短网址会打开浏览器或跳转 APP Fix https://github.com/siyuan-note/siyuan/issues/6327
This commit is contained in:
parent
bbb818eb51
commit
d8553c6e2a
1 changed files with 11 additions and 4 deletions
|
|
@ -86,10 +86,8 @@ try {
|
|||
}
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
require('electron').
|
||||
dialog.
|
||||
showErrorBox('创建配置目录失败 Failed to create config directory',
|
||||
'思源需要在用户家目录下创建配置文件夹(~/.config/siyuan),请确保该路径具有写入权限。\n\nSiYuan needs to create a configuration folder (~/.config/siyuan) in the user\'s home directory. Please make sure that the path has write permissions.')
|
||||
require('electron').dialog.showErrorBox('创建配置目录失败 Failed to create config directory',
|
||||
'思源需要在用户家目录下创建配置文件夹(~/.config/siyuan),请确保该路径具有写入权限。\n\nSiYuan needs to create a configuration folder (~/.config/siyuan) in the user\'s home directory. Please make sure that the path has write permissions.')
|
||||
app.exit()
|
||||
}
|
||||
|
||||
|
|
@ -332,10 +330,19 @@ const boot = () => {
|
|||
if (url.startsWith('http://127.0.0.1:6806')) {
|
||||
return
|
||||
}
|
||||
console.log("will-navigate", url)
|
||||
event.preventDefault()
|
||||
shell.openExternal(url)
|
||||
})
|
||||
|
||||
// iframe 使用短网址会打开浏览器或跳转 APP https://github.com/siyuan-note/siyuan/issues/6327
|
||||
mainWindow.webContents.on('will-redirect', (event, url) => {
|
||||
if (url.startsWith('http://127.0.0.1:6806')) {
|
||||
return
|
||||
}
|
||||
event.preventDefault()
|
||||
})
|
||||
|
||||
mainWindow.on('close', (event) => {
|
||||
if (mainWindow && !mainWindow.isDestroyed()) {
|
||||
mainWindow.webContents.send('siyuan-save-close', false)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue