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

[Bug]: Renderer spellcheck API does not work on Windows #28684

Open
3 tasks done
lishid opened this issue Apr 15, 2021 · 6 comments
Open
3 tasks done

[Bug]: Renderer spellcheck API does not work on Windows #28684

lishid opened this issue Apr 15, 2021 · 6 comments

Comments

@lishid
Copy link
Contributor

@lishid lishid commented Apr 15, 2021

Preflight Checklist

Electron Version

12.0.4

What operating system are you using?

Windows

Operating System Version

Windows 10 1909

What arch are you using?

x64

Last Known Working Electron version

None

Expected Behavior

Expecting require('electron').webFrame.isWordMisspelled('testt') to return true.

Actual Behavior

require('electron').webFrame.isWordMisspelled('testt') returns false.

Testcase Gist URL

https://gist.github.com/lishid/53782e6e43f4bc431ac1fed3bff33c85

@lishid
Copy link
Contributor Author

@lishid lishid commented Apr 15, 2021

Previously on #28404 (Issue was erroneously closed and subsequently forgotten). Please consider re-opening original issue if marking this one is as duplicate.

This API works on Linux perfectly fine. On Windows, despite the textarea detecting the spell error, the API still returns false.

@Jelmerro
Copy link

@Jelmerro Jelmerro commented Apr 28, 2021

A user of one of my apps ran into this same issue, and when I started testing I noticed something strange. It actually does work for some languages on Windows (in my case nl), but it stops working when switching back to en-US. It also doesn't work before calling setSpellCheckerLanguages.

It works flawlessly on Linux, even before calling the language list API. And keeps working once you do call it regardless of the language list.

@abnerlee
Copy link

@abnerlee abnerlee commented May 16, 2021

Confirmed this bug too on v12.0.7 / windows 10.

Set en-GB works, but en-US is not working.

@VerteDinde
Copy link
Member

@VerteDinde VerteDinde commented Jun 14, 2021

Hey @Jelmerro, thanks for reporting this issue! I just took a look at your Fiddle gist and want to make sure I'm not misunderstanding - when I run the repro, I'm also seeing the test fail going back to (at least) Electron 8.5.5.

Can you confirm whether or not this ever worked as expected for your app, or did this break for you in Electron 12? Having that bisect is helpful to us when trying to solve the issue, so I just wanted to double check.

@Jelmerro
Copy link

@Jelmerro Jelmerro commented Jun 14, 2021

I did not report this issue, this is just something I ran into when working on one of my projects. It has been an issue for a while, that's why I thought that the other one was related as well. I only added word suggestions in a custom context menu when I was already on electron 12.0.5, but I can also reproduce this for much older versions (I just tested 8.5.5) as well.

@fxha
Copy link

@fxha fxha commented Jan 15, 2022

We have the same issue while trying to replace node-spellchecker with the built-in one and verified this on Electron v15 and v16. I guess this issue will be in backlog for a while but our observations:

  1. Windows only issue, the same logic runs without any problems on Linux (Hunspell)
  2. session.availableSpellCheckerLanguages are on both OSs the same -> Windows using Hunspell too?!
  3. dictionarySuggestions from win.webContents.on('context-menu', ... works on Windows successfully
  4. webFrame.getWordSuggestions and webFrame.isWordMisspelled are always empty/false on Windows without errors shown in log (--enable-logging)
  5. Misspelled words are red underlined in editable text

My wild guess is that this is an issue with the Windows spell checker and Chromium. Maybe we hitting a precondition because Electron expects to use Hunspell but Chromium expects to have a valid platform specific spell checker in the renderer. Unfortunately, I'm unable to build Chromium and hope this can be fixed. For now, both APIs have no functionality on Windows.

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

Successfully merging a pull request may close this issue.

None yet
6 participants