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

Spell checker not working properly #376

Open
Refold3547 opened this issue Dec 17, 2024 · 17 comments
Open

Spell checker not working properly #376

Refold3547 opened this issue Dec 17, 2024 · 17 comments

Comments

@Refold3547
Copy link

The spell checker is enabled by default in the latest mullvadbrowser settings.

However, it needs to be manually enabled via the right mouse button every time the browser is restarted.

Firefox

Additional information:

  • No new extensions installed
  • I am using the latest version of mullvad browser (14.0.3)
  • The program language (pt-BR) was set automatically
  • Windows 11 version: 24h2
@Thorin-Oakenpants
Copy link

This is exactly the same as Firefox. Spellcheck is by default only autorun on inputs of more than a single line - e.g. textarea with 2 or more rows

layout.spellcheckDefault in about:config controls this

  • 0 = spellcheck nothing
  • 1 = check multi-line controls (default)
  • 2 = check multi/single line controls

tada

@Thorin-Oakenpants
Copy link

also note that websites can disable spellcheck .. e.g.

<textarea spellcheck="false"></textarea>

@Refold3547
Copy link
Author

This is exactly the same as Firefox. Spellcheck is by default only autorun on inputs of more than a single line - e.g. textarea with 2 or more rows

* 0 = spellcheck nothing

* 1 = check multi-line controls (default)

* 2 = check multi/single line controls

Thank you for the tip. I changed the layout.spellcheckDefault to 2, and it resolved the issue of the spell check not being enabled.

Now, another problem has been found: even after selecting my language in the spell check options (portuguese Brazil), when I restart the browser, only the English language is activated by default. Is there any way to keep my native language active permanently?

Firefox

@Thorin-Oakenpants
Copy link

Thorin-Oakenpants commented Dec 18, 2024

and it resolved the issue of the spell check not being enabled

.. not being enabled on single line content - fixed that for you. The enabling/disabling of the spellcheck as a feature is a different setting


Can you explain to me where and how did you add a pt spellcheck

@Thorin-Oakenpants

This comment was marked as resolved.

@Thorin-Oakenpants
Copy link

works for me - I set language to pt-BR and restarted. Added the dictionary and tested. Closed and restarted, tested again.

test

@Thorin-Oakenpants
Copy link

even with spoof english (for web content - see pic, checked means I request en-US pages) I am still using the Portuguese spellcheck

spoof english setting

@PieroV any idea on why the default spellcheck is getting reset?

@Thorin-Oakenpants
Copy link

Thorin-Oakenpants commented Dec 18, 2024

actually I have the opposite problem. Now I can't get changing to en-US to stick between restarts. I don't know if that right click menu is for session only - Firefox seems to lack a decent UI for spellcheck settings

--

ok, I can. It seems to change to match the app language for me. When I use en-US on restart the dictionary is en-US, when I start as pt-BR (with or without spoof english) the default dictionary is changed to pt-BR

edit: there's also about:addons > dictionaries .. where the only installed dictionary I have is pt-BR - and it is already set as default

@Thorin-Oakenpants
Copy link

https://searchfox.org/mozilla-central/rev/df68a65540f2227e27a12ed0b491188e2927f6d5/editor/spellchecker/EditorSpellCheck.cpp#837-861

/*
   * We try to derive the dictionary to use based on the following priorities:
   * 1) Content preference, so the language the user set for the site before.
   *    (Introduced in [bug 678842](https://bugzilla.mozilla.org/show_bug.cgi?id=678842) and corrected in [bug 717433](https://bugzilla.mozilla.org/show_bug.cgi?id=717433).)
   * 2) Language set by the website, or any other dictionary that partly
   *    matches that. (Introduced in [bug 338427](https://bugzilla.mozilla.org/show_bug.cgi?id=338427).)
   *    Eg. if the website is "en-GB", a user who only has "en-US" will get
   *    that. If the website is generic "en", the user will get one of the
   *    "en-*" installed. If application locale or system locale is "en-*",
   *    we get it. If others, it is (almost) random.
   *    However, we prefer what is stored in "spellchecker.dictionary",
   *    so if the user chose "en-AU" before, they will get "en-AU" on a plain
   *    "en" site. (Introduced in [bug 682564](https://bugzilla.mozilla.org/show_bug.cgi?id=682564).)
   *    If the site has multiple languages declared in its Content-Language
   *    header and there is no more specific lang tag in HTML, we try to
   *    enable a dictionary for every content language.
   * 3) The value of "spellchecker.dictionary" which reflects a previous
   *    language choice of the user (on another site).
   *    (This was the original behaviour before the aforementioned bugs
   *    landed).
   * 4) The user's locale.
   * 5) Use the current dictionary that is currently set.
   * 6) The content of the "LANG" environment variable (if set).
   * 7) The first spell check dictionary installed.
   */

@Thorin-Oakenpants
Copy link

Thorin-Oakenpants commented Dec 18, 2024

@Refold3547 can you give me an URL where you get the english spellcheck and not the pt one? Sounds like point 2 above (note we don't do step 1 across restarts, site preferences are session only) - i.e the site is english .. or maybe point 7 (since it's the one we ship with)

@Refold3547
Copy link
Author

Refold3547 commented Dec 18, 2024

Unfortunately, the settings do not stay saved in my browser. Could you help me find the problem? I even made a video showing this:

Video.mp4

I just installed the following spell checker for my language: https://addons.mozilla.org/pt-BR/firefox/addon/verificador-ortogr%C3%A1fico-para-p/

Since I don't write many messages in English, I use the default dictionary that came pre-installed in Mullvad Browser.

PS: spoof english is active

@Thorin-Oakenpants
Copy link

Thorin-Oakenpants commented Dec 18, 2024

Unfortunately, the settings do not stay saved in my browser

There is no setting - it is determined by the logic here

This is upstream Firefox and not something that Tor Project or Mullvad Browser will be able to fix (in my opinion) - it would require lots of research and as far as I know, dictionaries are an area that hasn't had a lot of attention from Mozilla over the years

If I understand it correctly, first of all, the dictionary used relies on site settings (which Mullvad Browser does not save between sessions). Then it relies on the language set by the web site, which Mullvad Browser has no control over except when a site sets the language based on request headers - and you're spoofing as english.

If none of those are used, then it uses your locale (and you're spoofing as english) - however I am not sure if it uses the "spoofed" (it's not spoofed, we actually setting and using it) web-content language or the app language. I suspect the former

And down the list .. current dictionary -> first dictionary installed (which is english)

I do not think you will ever get spoof english to use Portuguese (although I seemed to) - and if we did, then users will complain that when spoofing english they can't get english spellchecker

There's no easy answer here other than upstream for Firefox to allow users to set a dictionary choice that uses no logic, just uses that dictionary

@Refold3547
Copy link
Author

Infelizmente, as configurações não ficam salvas no meu navegador

Não há configuração - é determinada pela lógica aqui

Este é o Firefox upstream e não algo que o Tor Project ou Mullvad Browser será capaz de corrigir (na minha opinião) - seria necessária muita pesquisa e, tanto quanto eu sei, dicionários são uma área que não teve muita atenção da Mozilla ao longo dos anos

Se eu entendi corretamente, em primeiro lugar, o dicionário usado depende das configurações do site (que o Mullvad Browser não salva entre as sessões). Em seguida, ele se baseia no idioma definido pelo site, sobre o qual o Mullvad Browser não tem controle, exceto quando um site define o idioma com base nos cabeçalhos de solicitação - e estás a fingir como inglês.

Se nenhum deles for usado, ele usará sua localidade (e estás a fingir como inglês) - no entanto, não tenho certeza se ele usa o idioma de conteúdo da web "spoofed" (não é falsificado, na verdade, definimos e usamos) ou o idioma do aplicativo. Suspeito do primeiro

E abaixo da lista .. dicionário atual -> primeiro dicionário instalado (que é inglês)

Eu não acho que você nunca vai ter spoof inglês para usar Português (embora eu parecesse) - e se nós fizemos, então os usuários vão reclamar que quando spoofing inglês eles não podem obter corretor ortográfico Inglês

Não há uma resposta fácil aqui além do upstream para o Firefox para permitir que os usuários definam uma escolha de dicionário que não use lógica, apenas use esse dicionário

I understand. Thank you very much for the explanation!
In my case, would there be any way that I uninstall the English dictionary and force the browser to use only the dictionary in my language? I believe this would solve the problem momentarily.

@Thorin-Oakenpants
Copy link

In my case, would there be any way that I uninstall the English dictionary

no, not easily

force the browser to use [a specific] dictionary

this would require changes at Firefox

@PieroV
Copy link
Collaborator

PieroV commented Dec 19, 2024

@PieroV any idea on why the default spellcheck is getting reset?

Nope, not out of my mind.
I can investigate, but maybe can you open an issue on GitLab?
I won't realistically get to it today, which means I'll look on it after Jan 7 😄.

@Thorin-Oakenpants
Copy link

Nope, not out of my mind

I don't think it's being "reset" - see this - I seemed to get mine to stay as pt even with spoof english, but that was before I read the logic linked, and the test page I was using had no language set. It's all very messy and convoluted

@Thorin-Oakenpants
Copy link

all spellcheck bugzillas feel free to peruse

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

No branches or pull requests

3 participants