Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 673
Andrew Avatar asked Oct 05 '11 01:10

Andrew


1 Answers

Calling -[WebPreferences setPreferencesIdentifier:] so that your WebView gets its own WebPreferences copy appears to be an effective workaround.

like image 158
Ira Rosenblatt Avatar answered Oct 13 '22 00:10

Ira Rosenblatt