Open cztomczak opened 7 years ago
New API exposed in the Browser object in commit 81a8558:
Keeping this issue Open as it contains useful information such as command line switches to configure spell checking support and thus was labeled as Knowledge Base.
Spell checking was implemented in upstream CEF as part of CEF Issue #137. Spell checking is already working in latest CEF Python v54 / v55. Tested on Linux with hello_world.py using the w3schools textarea example. Works out of the box. The "w3schools.com" word is underscored and when mouse right clicking on it, there appears "Add to dictionary" menu option along with a suggestion word to correct it.
Note that "Add to dictionary" creates "Custom dictionary.txt" file in cwd - needs to be figured out how to configure that.
So basically spell checking works in CEF Python, but there are still API functions that were not yet exposed to CEF Python. This will need additional work, read on further down.
Here are the features of spell checking support:
New command line flags that allow for configuration of spell checking:
--disable-spell-checking
- Disable spell-checking support (no red underline, no dictionary file download, etc).--enable-spelling-auto-correct
- Automatically correct common misspellings while typing (like 'omre' to 'more' on Windows/Linux or 'ehlo' to 'helo' on OS X).--enable-spelling-service
=> Enable use of the remote Google spelling service (this requires Google API keys).--override-spell-check-lang=<LANG>
- Use the specified dictionary languageThere are new methods in CefBrowser class that are related to spell checking. These methods are yet to be exposed to CEF Python:
There are also new methods in CefContextMenuParams. This object was not yet exposed to CEF Python. There was created Issue #56 ("Support creation and modification of mouse context menu") for that. Currently mouse context menu is configurable using ApplicationSettings.context_menu option. Below is a list of new context menu items and methods in CefContextMenuParams related to spell checking. These may be used to allow for more customization of context menu: