Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions packages/compass/src/main/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,20 @@ class CompassApplication {
// Accessing isEncryptionAvailable is not allowed when app is not ready on Windows
// https://github.com/electron/electron/issues/33640
await app.whenReady();

const { networkTraffic } = this.preferences.getPreferences();

if (!networkTraffic) {
// Electron fetches spellcheck dictionaries from a CDN
// on all OSs expect mac (it provides a built-in spell check).
// 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(
'http://127.0.0.1:0/'
);
}

log.info(
mongoLogId(1_001_000_307),
'Application',
Expand Down
8 changes: 0 additions & 8 deletions packages/compass/src/main/window-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ function showConnectWindow(
};

debug('creating new main window:', windowOpts);
const { preferences } = compassApp;
const { networkTraffic } = preferences.getPreferences();

let window: BrowserWindow | null = new BrowserWindow(windowOpts);
if (mongodbUrl) {
Expand All @@ -150,12 +148,6 @@ function showConnectWindow(
if (connectionId) {
registerConnectionIdForBrowserWindow(window, connectionId);
}
if (networkTraffic !== true) {
// https://github.com/electron/electron/issues/22995
window.webContents.session.setSpellCheckerDictionaryDownloadURL(
'http://127.0.0.1:0/'
);
}

enable(window.webContents);
const unsubscribeProxyListenerPromise = compassApp.setupProxySupport(
Expand Down
Loading