Skip to content

Web 端无法使用块超链接在页面内跳转 #3961

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

Closed
Zuoqiu-Yingyi opened this issue Jan 30, 2022 · 4 comments
Closed

Web 端无法使用块超链接在页面内跳转 #3961

Zuoqiu-Yingyi opened this issue Jan 30, 2022 · 4 comments

Comments

@Zuoqiu-Yingyi
Copy link
Contributor

描述问题 Describe the problem

单击 Web 端内形如 siyuan://blocks/20200812220555-lj3enxa 块超链接会直接使用浏览器打开该链接, 浏览器将会使用 URL scheme 打开桌面应用(一般如下图所示), 因此在 Web 端完全无法使用超链接跳转块

image

期待的结果 Expected result

首先从 Web 端中查询是否命中一个块, 如果命中则在页面内直接跳转, 如果没有命中再使用 URL scheme 唤起桌面端

版本环境 Version environment

  • Version: 1.7.9
  • Browser (if used): Firefox 96.0.3 (64 位)
@88250
Copy link
Member

88250 commented Jan 30, 2022

这个不太确定是否能够拦截 URL 打开的请求,有空的话麻烦帮忙调研看看。

@Zuoqiu-Yingyi
Copy link
Contributor Author

这个不太确定是否能够拦截 URL 打开的请求,有空的话麻烦帮忙调研看看。

@88250 覆写 <a> 标签的 onclick 方法应该可以?

@88250
Copy link
Member

88250 commented Jan 30, 2022

DOM 最好不要改变,否则可能会引入其他问题。

@88250
Copy link
Member

88250 commented Feb 3, 2022

即使能实现,但是如果要跳转 siyuan:// 的话又得改变交互,所以暂时不考虑了。

@88250 88250 closed this as completed Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants