Skip to content
This repository was archived by the owner on Apr 8, 2021. It is now read-only.

Commit 276ae24

Browse files
committed
Add support for Electron 5 and above
Starting with Electron 5.0.0, the function `webFrame.setSpellCheckProvider` has a different signature, in order to support asynchronous spell checkers. For more information on this change in Electron, see electron/electron#14032. This diff updates `SpellCheckHandler` to use the new interface if running on Electron 5.0.0 and above. However, it still checks the spelling synchronously like before. If running on Electron versions below 5.0.0, the `SpellCheckHandler` still works. Closes electron-userland#144.
1 parent 82ad22c commit 276ae24

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/spell-check-handler.js

-4
Original file line numberDiff line numberDiff line change
@@ -465,14 +465,10 @@ module.exports = class SpellCheckHandler {
465465
*/
466466
setSpellCheckProvider(webFrame) {
467467
if (process.versions.electron >= '5.0.0') {
468-
d('DEBUG: Setting provider for Electron 5');
469-
// Electron 5 and above:
470468
webFrame.setSpellCheckProvider(
471469
this.currentSpellcheckerLanguage,
472470
{ spellCheck: this.handleElectronSpellCheck.bind(this) });
473471
} else {
474-
d('DEBUG: Setting provider for Electron 4');
475-
// Electron 4 and below:
476472
webFrame.setSpellCheckProvider(
477473
this.currentSpellcheckerLanguage,
478474
this.shouldAutoCorrect,

0 commit comments

Comments
 (0)