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

🐞 反馈问题:在huggingface网页划词失败,已开启强制划词 #824

Closed
5 of 6 tasks
taklele opened this issue Feb 21, 2025 · 4 comments
Closed
5 of 6 tasks
Assignees
Labels
bug Something isn't working fixed in next release The issue will be closed once next release is available

Comments

@taklele
Copy link

taklele commented Feb 21, 2025

请先确认以下事项:

  • 请务必查看 常见问题
  • 已仔细阅读了 README
  • issues 页面搜索过问题(包括已关闭的 issue),但未能找到解决方法
  • Easydict 已升级到 最新版本
  • 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 issue 可能会被无视或直接关闭

问题描述

网址:huggingface

这个页面中划词失败,其他网页也有类似情况。

该问题是否可以稳定重现?

可重现

重现步骤

打开网页,选中任意字符,快捷键>划词翻译。

截图

Image

运行日志(zip 文件)

com.izual.Easydict 2025-02-20--08-19-46-498.log.zip

期望结果

期望划词-取词成功翻译

解决方案(可选)

No response

设备型号 && 系统版本

Apple M1 mini, macOS 14.0

是否愿意提交 PR 解决该问题?

  • 我愿意提交 PR 来解决该问题
@taklele taklele added the bug Something isn't working label Feb 21, 2025
@tisfeng
Copy link
Owner

tisfeng commented Feb 22, 2025

可能是 AppleScript 取词出现了异常,请检查浏览器是否开启了【允许 Apple 事件中的 JavaScript】,如果已开启,请尝试关闭,然后重新开启。

另外,【隐私与安全性】-【自动化】下面的权限设置也类似,关闭后重新开启试试。

Image

@taklele
Copy link
Author

taklele commented Feb 22, 2025

谢谢回复。我测试了一下,

  1. 当【允许 Apple 事件中的 JavaScript】 开启:有的网页能取词,有的不能。
    比如当前github issues 页面就能正常取词。切换标签页到huggingface页面就无法取词。

  2. 当【允许 Apple 事件中的 JavaScript】 关闭:所有网页都能取词。
    无论是github还是huggingface,测试了几个页面都可以。


chrome版本 133.0.6943.127(正式版本) (arm64)

@tisfeng
Copy link
Owner

tisfeng commented Mar 2, 2025

当【允许 Apple 事件中的 JavaScript】 关闭:所有网页都能取词。

当 Accessibility 取词失败时,浏览器会优先使用 AppleScript 取词,而不是强制取词。

某些异常情况下,AppleScript 取词成功,但返回结果是空的,因此会失败。

如果此时关闭 JavaScript 事件,则会直接报错,然后会尝试进行强制取词,这时候就取词成功了。

稍后我们会优化浏览器取词流程,尽量确保取词成功。

@tisfeng tisfeng self-assigned this Mar 2, 2025
@tisfeng tisfeng added the fixed in next release The issue will be closed once next release is available label Mar 2, 2025
@tisfeng
Copy link
Owner

tisfeng commented Mar 6, 2025

2.12.0 版本已改进浏览器取词。

@tisfeng tisfeng closed this as completed Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in next release The issue will be closed once next release is available
Projects
None yet
Development

No branches or pull requests

2 participants