From fd9e031f0dd30c28ef759be056f008f669d15fc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Charles?= Date: Mon, 3 Jun 2019 20:56:46 +0200 Subject: [PATCH] docs: Update breaking changes on webFrame.setSpellCheckProvider (#17915) * doc: Update breaking changes on webFrame.setSpellCheckProvider * doc: fix example * doc: lint: extra semicolon * Update docs/api/breaking-changes.md Co-Authored-By: magne4000 --- docs/api/breaking-changes.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/api/breaking-changes.md b/docs/api/breaking-changes.md index 7875a1fecfa5..047f103283bc 100644 --- a/docs/api/breaking-changes.md +++ b/docs/api/breaking-changes.md @@ -200,6 +200,23 @@ webFrame.setIsolatedWorldInfo( }) ``` +## `webFrame.setSpellCheckProvider` +The `spellCheck` callback is now asynchronous, and `autoCorrectWord` parameter has been removed. +```js +// Deprecated +webFrame.setSpellCheckProvider('en-US', true, { + spellCheck: (text) => { + return !spellchecker.isMisspelled(text) + } +}) +// Replace with +webFrame.setSpellCheckProvider('en-US', { + spellCheck: (words, callback) => { + callback(words.filter(text => spellchecker.isMisspelled(text))) + } +}) +``` + ## Planned Breaking API Changes (4.0) The following list includes the breaking API changes made in Electron 4.0.