Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux 端支持 URL Scheme siyuan:// #4513

Closed
choyy opened this issue Apr 6, 2022 · 4 comments
Closed

Linux 端支持 URL Scheme siyuan:// #4513

choyy opened this issue Apr 6, 2022 · 4 comments
Assignees
Milestone

Comments

@choyy
Copy link

choyy commented Apr 6, 2022

目前 linux 下 url scheme 在思源未打开时无法正确跳转,不过在社区已有人给出解决方案:

然后回到 main.js 文件,查找 mainWindow.webContents.on('did-finish-load', () => {,修改:

  if ('linux' === process.platform || 'win32' === process.platform) { //Modified
    siyuanOpenURL = process.argv.find((arg) => arg.startsWith('siyuan://'))
  }
  if (siyuanOpenURL) {
    setTimeout(() => { // 等待界面js执行完毕
      writeLog(siyuanOpenURL)
      mainWindow.webContents.send('siyuan-openurl', siyuanOpenURL)
      siyuanOpenURL = null
    }, 2000)
  }
})

作者:Clouder
链接:https://ld246.com/article/1634908196973
来源:链滴
协议:CC BY-SA 4.0 https://creativecommons.org/licenses/by-sa/4.0/

希望加入该更改

@88250 88250 changed the title Linux 下 url scheme 令首次打开生效 Linux 下支持 URL Scheme siyuan:// Apr 6, 2022
@88250 88250 changed the title Linux 下支持 URL Scheme siyuan:// Linux 端支持 URL Scheme siyuan:// Apr 6, 2022
@88250 88250 self-assigned this Apr 7, 2022
@88250 88250 added this to the 1.9.7 milestone Apr 7, 2022
@88250 88250 closed this as completed Apr 7, 2022
88250 added a commit to siyuan-note/user-guide-zh_CN that referenced this issue Apr 7, 2022
88250 added a commit to siyuan-note/user-guide-zh_CHT that referenced this issue Apr 7, 2022
88250 added a commit to siyuan-note/user-guide-en_US that referenced this issue Apr 7, 2022
@88250
Copy link
Member

88250 commented Apr 7, 2022

下个版本加入这个改动,但是不确定能否正常工作,发版以后请帮忙验证,谢谢。

@choyy
Copy link
Author

choyy commented Apr 7, 2022

这个改动我试过了,可以正常工作

@88250
Copy link
Member

88250 commented Apr 7, 2022

我怕我改错了 😂

@choyy
Copy link
Author

choyy commented Apr 7, 2022

运行正常

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants