WebView (webkit)“在字典中查找” UI 错误 - Mac 应用程序
我发现 WebView 的一个错误很容易重新创建但很难解决,并且正在寻找建议和最好的答案。
该错误是当您以任何方式使用苹果内置词典“查找”命令、上下文菜单、多点触控手势(3 指双击)或标准全局热键“cmd ctrl d”时。调用字典查找命令后,将出现一个弹出窗口,其中包含您突出显示的单词的定义。但是,页面上的文本有时会变得模糊,并且表单/字段不再正确响应 mouseDown 等输入事件。
正如我之前所说,复制非常容易。我已将示例项目上传到 GitHub。
https://github.com/ChimpStudios/WebView-DictionaryBug
Safari 没有此错误,所以苹果以某种方式修复了它,但它仍然存在于 WebView 对象中。
I've found a bug with WebView that is easy to recreate but hard to solve and am looking for suggestions and preferably answers.
The bug is when you use Apple's built in dictionary "look up" command by any means, contextual menu, multi touch gesture (3 finger double tap), or the standard global hot key "cmd ctrl d". After invoking the dictionary look up command, a popover will appear with the definition of the word you highlighted. However, text on the page sometimes gets blurred and forms/fields no longer respond properly to input events like mouseDown.
Like I said earlier, it is pretty easy to duplicate. I've uploaded a sample project to GitHub.
https://github.com/ChimpStudios/WebView-DictionaryBug
Safari doesn't have this bug, so somehow Apple fixed it, but it still exists in the WebView object.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
调用 -[WebPreferences setPreferencesIdentifier:] 以便您的 WebView 获得自己的 WebPreferences 副本似乎是一种有效的解决方法。
Calling -[WebPreferences setPreferencesIdentifier:] so that your WebView gets its own WebPreferences copy appears to be an effective workaround.