WebView (webkit) "Look Up In Dictionary" UI Bug - Mac App

I found a bug with WebView that is easy to recreate, but hard to solve, and I am looking for suggestions and, preferably, answers.

The error is that you use the built-in dictionary lookup by any means, the context menu, a gesture with a few touches (3 fingers double-tap) or the standard global hotkey "cmd ctrl d". After calling the dictionary search command, an inscription appears with the definition of the word that you highlighted. However, the text on the page is sometimes blurred, and the forms / fields no longer respond properly to input events such as mouseDown.

As I said earlier, it's pretty easy to duplicate. I uploaded a sample project to GitHub.

https://github.com/ChimpStudios/WebView-DictionaryBug

Safari doesn't have this error, so Apple somehow fixed it, but it still exists in the WebView object.

+6
source share
1 answer

Calling [WebPreferences setPreferencesIdentifier:] so that your WebView gets its own copy of WebPreferences is an efficient workaround.

+2
source

Source: https://habr.com/ru/post/898638/


All Articles