File tree Expand file tree Collapse file tree 2 files changed +20
-8
lines changed
packages/compass/src/main Expand file tree Collapse file tree 2 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,20 @@ class CompassApplication {
129129 // Accessing isEncryptionAvailable is not allowed when app is not ready on Windows
130130 // https://github.com/electron/electron/issues/33640
131131 await app . whenReady ( ) ;
132+
133+ const { networkTraffic } = this . preferences . getPreferences ( ) ;
134+
135+ if ( ! networkTraffic ) {
136+ // Electron fetches spellcheck dictionaries from a CDN
137+ // on all OSs expect mac (it provides a built-in spell check).
138+ // Passing a non-resolving URL prevents it from fetching
139+ // as there aren't any options to disable it provided.
140+ // https://github.com/electron/electron/issues/22995
141+ session . defaultSession . setSpellCheckerDictionaryDownloadURL (
142+ 'http://127.0.0.1:0/'
143+ ) ;
144+ }
145+
132146 log . info (
133147 mongoLogId ( 1_001_000_307 ) ,
134148 'Application' ,
Original file line number Diff line number Diff line change 33 * https://github.com/atom/electron/blob/main/docs/api/browser-window.md
44 */
55import { pathToFileURL } from 'url' ;
6+ import fs from 'fs' ;
7+ import os from 'os' ;
68import path from 'path' ;
79import type { HadronIpcMainEvent } from 'hadron-ipc' ;
810import { ipcMain } from 'hadron-ipc' ;
@@ -82,6 +84,10 @@ async function showWindowWhenReady(bw: BrowserWindow) {
8284 bw . show ( ) ;
8385}
8486
87+ // function readLogFile() {
88+
89+ // }
90+
8591/**
8692 * Call me instead of using `new BrowserWindow()` directly because i'll:
8793 *
@@ -140,8 +146,6 @@ function showConnectWindow(
140146 } ;
141147
142148 debug ( 'creating new main window:' , windowOpts ) ;
143- const { preferences } = compassApp ;
144- const { networkTraffic } = preferences . getPreferences ( ) ;
145149
146150 let window : BrowserWindow | null = new BrowserWindow ( windowOpts ) ;
147151 if ( mongodbUrl ) {
@@ -150,12 +154,6 @@ function showConnectWindow(
150154 if ( connectionId ) {
151155 registerConnectionIdForBrowserWindow ( window , connectionId ) ;
152156 }
153- if ( networkTraffic !== true ) {
154- // https://github.com/electron/electron/issues/22995
155- window . webContents . session . setSpellCheckerDictionaryDownloadURL (
156- 'http://127.0.0.1:0/'
157- ) ;
158- }
159157
160158 enable ( window . webContents ) ;
161159 const unsubscribeProxyListenerPromise = compassApp . setupProxySupport (
You can’t perform that action at this time.
0 commit comments