You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Red underline of misspelled words in html text areas.
Right-click context menu options to correct the misspelled word.
"Add to dictionary" context menu option.
Download dictionary is being downloaded and cached automatically on Windows and Linux. It is being downloaded to ApplicationSettings.user_data_path directory (if not set default platform-specific directories are used).
On OS X the spell checking implementation will use the system NSSpellChecker implementation.
Uses the unified text checker when auto-correct is not enabled to match Google Chrome behavior.
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).
There are new methods in CefBrowser class that are related to spell checking. These methods are yet to be exposed to CEF Python:
///
// If a misspelled word is currently selected in an editable node calling
// this method will replace it with the specified |word|.
///
/*--cef()--*/
virtual void ReplaceMisspelling(const CefString& word) =0;
///
// Add the specified |word| to the spelling dictionary.
///
/*--cef()--*/
virtual void AddWordToDictionary(const CefString& word) =0;
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:
MENU_ID_SPELLCHECK_SUGGESTION_0 = 200,
MENU_ID_SPELLCHECK_SUGGESTION_1 = 201,
MENU_ID_SPELLCHECK_SUGGESTION_2 = 202,
MENU_ID_SPELLCHECK_SUGGESTION_3 = 203,
MENU_ID_SPELLCHECK_SUGGESTION_4 = 204,
MENU_ID_SPELLCHECK_SUGGESTION_LAST = 204,
MENU_ID_NO_SPELLING_SUGGESTIONS = 205,
MENU_ID_ADD_TO_DICTIONARY = 206,
///
// Returns the text of the misspelled word, if any, that the context menu was
// invoked on.
///
/*--cef()--*/
virtual CefString GetMisspelledWord() =0;
///
// Returns true if suggestions exist, false otherwise. Fills in |suggestions|
// from the spell check service for the misspelled word if there is one.
///
/*--cef()--*/
virtual bool GetDictionarySuggestions(std::vector<CefString>& suggestions) =0;
///
// Returns true if the context menu was invoked on an editable node where
// spell-check is enabled.
///
/*--cef()--*/
virtual bool IsSpellCheckEnabled() =0;
The text was updated successfully, but these errors were encountered:
See also Issue #274 to see command line switches related to spell
checking support.
Run wxpython example after compile.
Fix linux make-setup.py.
Update tools/toc.py.
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 language instead of the language specified in the locales.pak file. To see the default/supported dictionary languages: https://code.google.com/p/chromium/codesearch#search/&q=IDS_SPELLCHECK_DICTIONARY%20xtb&sq=package:chromiumThere 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:
The text was updated successfully, but these errors were encountered: