Skip to content

fix(compass): disable spellcheck before creating window when no network traffic COMPASS-8166 #6853

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Anemy
Copy link
Member

@Anemy Anemy commented Apr 9, 2025

COMPASS-8166

We already were disabling the spellcheck when network traffic was disabled, however it looks like it was being disabled after the request for the dictionary would happen. This pr updates when we do the override to happen earlier.

The other change here is ignoring Google's public DNS ip in our no network test as its an expected functionality of chromium:
https://source.chromium.org/chromium/chromium/src/+/main:net/dns/README.md;l=351

// to 2001:4860:4860::8888 (the IPv6 address for Google Public DNS).
(target) =>
!/^127.0.0.1:|^\[::1\]:/.test(target) &&
!/^\[2001:4860:4860::8888\]:443$/.test(target)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I guess this is something we can't control at all?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't found one yet.
It seems like electron command line switches redirect it with the host rules / host resolver rules.
https://www.electronjs.org/docs/latest/api/command-line-switches#--host-rulesrules
I'll spend a bit of time looking into that and circle back before merging.

// Passing a non-resolving URL prevents it from fetching
// as there aren't any options to disable it provided.
// https://github.com/electron/electron/issues/22995
session.defaultSession.setSpellCheckerDictionaryDownloadURL(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh wow. well caught.

Copy link
Contributor

@lerouxb lerouxb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! tricky one.

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

Successfully merging this pull request may close these issues.

3 participants