Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Electron 5 and above #149

Merged
merged 4 commits into from
Jun 12, 2019

Conversation

mlalkaka
Copy link
Contributor

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 #144.

mlalkaka added 4 commits June 10, 2019 17:34
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.
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.
@rickharris
Copy link

Tested this branch on Abstract's electron app in electron 5, and it's confirmed working. Thanks @mlalkaka!

@felixrieseberg
Copy link
Collaborator

Thank you very much!

@felixrieseberg felixrieseberg merged commit ebf3131 into electron-userland:master Jun 12, 2019
@aabuhijleh
Copy link
Contributor

Thank you @mlalkaka.

Though, I found out that spell checking is not working on Windows because in the SpellCheckProvider function handleElectronSpellCheck(words, callback), the callback is never called on Windows and hence no squiggly red lines will appear.

It's only called on macOS. I simply added callback(misspelled); to the bottom of the function and it worked properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

spellCheckHandler.attachToInput breaks on electron 5.0.0
4 participants