From d642fe60755e1a5ddf23769c3e34c74fa1a616d9 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 19 Dec 2014 22:34:34 -0800 Subject: [PATCH] docs: webFrame.setSpellCheckProvider --- docs/api/web-frame.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/api/web-frame.md b/docs/api/web-frame.md index 1bd00e41..f5bdd695 100644 --- a/docs/api/web-frame.md +++ b/docs/api/web-frame.md @@ -31,3 +31,26 @@ limits of 300% and 50% of original size, respectively. ## webFrame.getZoomLevel() Returns the current zoom level. + +## webFrame.setSpellCheckProvider(language, autoCorrectWord, provider) + +* `language` String +* `autoCorrectWord` Boolean +* `provider` Object + +Sets a provider for spell checking in input fields and text areas. + +The `provider` must be an object that has a `spellCheck` method that returns +whether the word passed is correctly spelled. + +An example of using [node-spellchecker][spellchecker] as provider: + +```javascript +require('web-frame').setSpellCheckProvider("en-US", true, { + spellCheck: function(text) { + return !(require('spellchecker').isMisspelled(text)); + } +}); +``` + +[spellchecker]: https://github.com/atom/node-spellchecker -- 2.43.0