Skip to content

Conversation

@PIKACHUIM
Copy link
Member

@PIKACHUIM PIKACHUIM commented Sep 25, 2025

Description / 描述

兼容浏览器内置PDF预览,一个是因为本来就应该支持,一个是因为Chromium增加了画笔工具,更好用了。

未对OpenList进行测试,本地html调用pdf以及直接Nginx下测试均无问题。

How Has This Been Tested? / 测试

Checklist / 检查清单

  • I have read the CONTRIBUTING document.
    我已阅读 CONTRIBUTING 文档。
  • I have formatted my code with go fmt or prettier.
    我已使用 go fmtprettier 格式化提交的代码。
  • I have added appropriate labels to this PR (or mentioned needed labels in the description if lacking permissions).
    我已为此 PR 添加了适当的标签(如无权限或需要的标签不存在,请在描述中说明,管理员将后续处理)。
  • I have requested review from relevant code authors using the "Request review" feature when applicable.

@jyxjjj jyxjjj requested a review from Copilot September 25, 2025 10:35

This comment was marked as resolved.

Copy link
Member

@xrgzs xrgzs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

302的不行吧?

@jyxjjj
Copy link
Member

jyxjjj commented Oct 6, 2025

302的不行吧?

我没找到好的办法既能兼容之前点击就带文件名下载,也兼容必须Inline的内置PDF预览功能。
但是这不是默认预览工具,且之前其他的预览,也有用户提到过部分不支持的情况。
所以我认为这个只要作为选项存在,而不是一定要能支持所有PDF。
可能要给每个302的地方都加上判断,或者如果别人网盘服务端没发文件名,那直接就支持了。
我认为可以合并。但可能我们需要加上说明?比如文档?

Copy link
Member

@xrgzs xrgzs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有问题,复现:./OpenList server --dev

Image

@jyxjjj
Copy link
Member

jyxjjj commented Nov 3, 2025

@xrgzs 我很长时间都没时间搞,我认为其实可以完全无视302,仅支持代理。带有限制性的功能没觉得有什么问题。这东西主要难点仅仅是我们给文件名都默认加上了。我不想复制一套Proxy逻辑加个路由专门给preview用,就只加了参数。如果302的时候会导致?需要变成&,我们没有nginx类似的$is_arg参数,也需要另外处理。
我这边先改成draft,看社区这么久也没有人提,我之前倒是有看到Issue提到的预览有问题可以通过浏览器内置功能解决,但一般都是用户自己的操作问题,没有任何急迫性甚至不是一个BUG。
我倒是确实觉得给用户可以用的变量少了点。

@jyxjjj jyxjjj marked this pull request as draft November 3, 2025 03:01
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

Successfully merging this pull request may close these issues.

4 participants