Spell check no longer working on Windows

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Spell check no longer working on Windows

Postby JasonLP » Mon Mar 08, 2021 1:24 pm

Has something changed recently that requires me to manually enable spellchecking in CEF, especially on Windows?

I have an application built with CEF on Chromium 86, and on Windows spellcheck works fine. But on Chromium 87 and 88, spellcheck no longer works. (i.e. The squiggly line no longer appears under a misspelled word.)

Interestingly, spellcheck continues to work as expected on Mac for all Chromium versions.

The Windows sample application cefclient.exe associated with the Chromium 88 distribution does work as expected. I don't see anything in the code there that seems relevant.

Any idea what might be going wrong?

Thanks,
-Jason-
JasonLP
Mentor
 
Posts: 98
Joined: Fri Jul 25, 2014 10:10 am

Re: Spell check no longer working on Windows

Postby magreenblatt » Mon Mar 08, 2021 3:22 pm

magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Spell check no longer working on Windows

Postby JasonLP » Mon Mar 08, 2021 3:36 pm

That was it. The workaround there works great.
Thanks!
JasonLP
Mentor
 
Posts: 98
Joined: Fri Jul 25, 2014 10:10 am

Re: Spell check no longer working on Windows

Postby lflince » Thu Sep 30, 2021 2:47 pm

The spell check does not activate en Windows whatever it does.

I have already reviewed the entire forum and what I find does not work, I have tried many things and I can't. The version of CEF that I use is 94.4.2+g6a963ca+chromium-94.0.4606.6, flat and it simply never activates. I test it on a Windows 10 machine.

My question is can or not activate spell check in CEF in windows and how?
lflince
Newbie
 
Posts: 4
Joined: Thu Sep 30, 2021 2:44 pm

Re: Spell check no longer working on Windows

Postby magreenblatt » Thu Sep 30, 2021 3:14 pm

magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Spell check no longer working on Windows

Postby magreenblatt » Thu Sep 30, 2021 3:20 pm

Or use the Chrome runtime.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Spell check no longer working on Windows

Postby lflince » Thu Sep 30, 2021 3:48 pm

nothing worked :(
lflince
Newbie
 
Posts: 4
Joined: Thu Sep 30, 2021 2:44 pm

Re: Spell check no longer working on Windows

Postby amaitland » Thu Sep 30, 2021 3:56 pm

lflince wrote:nothing worked :(


Just saying nothing worked doesn't help. You need to detail what you've tried exactly.

The source suggests the WinUseBrowserSpellChecker feature still exists.
https://source.chromium.org/chromium/ch ... s=chromium
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1291
Joined: Wed Jan 14, 2015 2:35 am

Re: Spell check no longer working on Windows

Postby lflince » Thu Sep 30, 2021 9:22 pm

I tried this:
command_line->AppendSwitch("-disable-features=WinUseBrowserSpellChecker");
command_line->AppendSwitch("-enable-chrome-runtime");

And this:

CefRefPtr<CefRequestContext> rc = browser->GetHost()->GetRequestContext();
CefRefPtr<CefListValue> spellcheck_dictionary = CefListValue::Create();
spellcheck_dictionary->SetSize(1);
spellcheck_dictionary->SetString(0, "es-ES");

CefString errtext;
CefRefPtr<CefValue> spellcheck_dictionary_value = CefValue::Create();
spellcheck_dictionary_value->SetList(spellcheck_dictionary);
rc->SetPreference("spellcheck.dictionaries", spellcheck_dictionary_value, errtext);

The browser.enable_spellchecking preference is already activated as the original code says. There is no need to activate it, when I get the value of spellcheck.dictionaries there is nothing, so I assign them. It is not clear to me when I should do it, but even I have a function in javascript that tells my code that the editor is ready and at that moment I assign the dictionary. On the other hand, the dictionary that I want to add is Spanish, but I'm not sure if I should put: "es", "es-ES" or "es_ES", I tried all of them and it does not work, the red line never appears under any word . I tried the html code in chrome and immediately the red line appears. I don't know in CEF what I should do.
In the chromium source codes there are two basic compilation directives (ENABLE_SPELLCHECK AND USE_BROWSER_SPELLCHECKER) for the SPELLCHECK to work:

#if BUILDFLAG (ENABLE_SPELLCHECK)
bool UseBrowserSpellChecker () {
#if! BUILDFLAG (USE_BROWSER_SPELLCHECKER)
return false;
#elif defined (OS_WIN)
return base :: FeatureList :: IsEnabled (spellcheck :: kWinUseBrowserSpellChecker) &&
WindowsVersionSupportsSpellchecker ();
#else
return true;
#endif
}

when libcef is compiled, I have not entered to see that part, but I do not think that it must be an esoteric topic that no one in this forum knows about. The thing is, I can't activate it.
lflince
Newbie
 
Posts: 4
Joined: Thu Sep 30, 2021 2:44 pm

Re: Spell check no longer working on Windows

Postby amaitland » Thu Sep 30, 2021 10:48 pm

Firstly the enable-chrome-runtime command line arg is only relevant to the CEF Sample applications.

You have to programmatically enable it see https://github.com/chromiumembedded/cef ... win.cc#L64

Secondly compiling CEF with USE_BROWSER_SPELLCHECKER build flag is possible and not something I would consider to be esoteric in the context of this forum, compiling CEF/Chromium is one of the major topics of discussion here.

Thirdly try the following

Code: Select all
command_line->AppendSwitchWithValue("disable-features", "CalculateNativeWinOcclusion,WinUseBrowserSpellChecker");


Load chrome://version in the browser itself and check the command line args you should see --disable-features=CalculateNativeWinOcclusion,WinUseBrowserSpellChecker with a leading two dashes.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1291
Joined: Wed Jan 14, 2015 2:35 am

Next

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 49 guests