Skip to content

PWA support (desktop & mobile) #8012

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

Merged
merged 8 commits into from
Apr 18, 2023
Merged

Conversation

Zuoqiu-Yingyi
Copy link
Contributor

@Zuoqiu-Yingyi Zuoqiu-Yingyi commented Apr 16, 2023

  • Please commit to the dev branch 请提交到 dev 开发分支
  • /stage/build/desktop//stage/build/mobild/ 站点提供 PWA 支持
    PWA support for /stage/build/desktop/ and /stage/build/mobild/ sites
    • 支持使用形如 web+siyuan://blocks/20210428212840-859h45j 的超链接打开指定的块
      Support for opening specified blocks with the hyperlink shaped like web+siyuan://blocks/20210428212840-859h45j
  • 修复重定向至 auth.html 时携带的 URL search params 未进行 URL 编码的问题
    Fixed the issue where URL search params are not escaped when redirecting to auth.html was not escaped.
  • 修复从 auth.html 重定向时未携带 URL search params 问题
    Fixed the issue where redirects from auth.html did not carry URL search params.

注: 由于 PWA 安全限制, 无法注册 safelisted scheme 以外的协议, 例如 siyuan://
Note: Due to PWA security restrictions, protocols other than safelisted scheme cannot be registered, such as siyuan://

REF:

已通过测试 | Tested passed

  • OS: Windows 11 22H2 22621.1555
  • Browser: Microsoft Edge 112.0.1722.48

Sorry, something went wrong.

@88250 88250 requested review from Vanessa219 and 88250 April 17, 2023 04:06
@88250 88250 added this to the 2.8.6 milestone Apr 17, 2023

Verified

This commit was signed with the committer’s verified signature.
@Zuoqiu-Yingyi
Copy link
Contributor Author

最好的解决方案是在打包时根据静态目录自动生成 INITIAL_CACHED_RESOURCES, 但是我没怎么用过 webpack~

@Zuoqiu-Yingyi Zuoqiu-Yingyi requested a review from 88250 April 18, 2023 11:02
@88250
Copy link
Member

88250 commented Apr 18, 2023

另外其他文件可能也会有变更,缓存了不会有什么副作用吧?

@Zuoqiu-Yingyi
Copy link
Contributor Author

Zuoqiu-Yingyi commented Apr 18, 2023

另外其他文件可能也会有变更,缓存了不会有什么副作用吧?

缓存的命名空间与版本号关联, 每次版本号发生更改时会请求新的 service-worker.js 文件, 之后 service-worker 会移除所有原有的缓存并启用新的缓存

所以最好在打包时更新 INITIAL_CACHED_RESOURCES

@88250
Copy link
Member

88250 commented Apr 18, 2023

嗯,我们合并了,感谢贡献。

@88250 88250 merged commit 93e4bb1 into siyuan-note:dev Apr 18, 2023
@Zuoqiu-Yingyi Zuoqiu-Yingyi deleted the dev-feat-pwa branch April 18, 2023 11:08
Vanessa219 added a commit that referenced this pull request Apr 19, 2023
@Vanessa219 Vanessa219 self-assigned this Apr 19, 2023
Vanessa219 added a commit that referenced this pull request Apr 19, 2023
Vanessa219 added a commit that referenced this pull request Apr 19, 2023
Vanessa219 added a commit that referenced this pull request Apr 19, 2023
@Zuoqiu-Yingyi Zuoqiu-Yingyi restored the dev-feat-pwa branch April 23, 2023 10:40
@Zuoqiu-Yingyi Zuoqiu-Yingyi deleted the dev-feat-pwa branch April 23, 2023 11:04
@88250 88250 mentioned this pull request Apr 25, 2023
1 task
@flyingnight
Copy link

能不能设置一键修改所有超链接打开指定的块?使用docker的时候,经常会自动跳转到思源软件,希望在设置内添加一个一键更换PWA链接和思源原生链接,这样适合两种情况。

@Zuoqiu-Yingyi
Copy link
Contributor Author

能不能设置一键修改所有超链接打开指定的块?使用docker的时候,经常会自动跳转到思源软件,希望在设置内添加一个一键更换PWA链接和思源原生链接,这样适合两种情况。

需要思源本体的支持, 使用超链接跳转 PWA 应用时会通过新窗口打开, 无法复用已打开的窗口进行跳转

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

Successfully merging this pull request may close these issues.

None yet

5 participants