File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed
packages/compass/src/main Expand file tree Collapse file tree 2 files changed +14
-9
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 @@ -140,22 +140,13 @@ function showConnectWindow(
140140 } ;
141141
142142 debug ( 'creating new main window:' , windowOpts ) ;
143- const { preferences } = compassApp ;
144- const { networkTraffic } = preferences . getPreferences ( ) ;
145-
146143 let window : BrowserWindow | null = new BrowserWindow ( windowOpts ) ;
147144 if ( mongodbUrl ) {
148145 registerMongoDbUrlForBrowserWindow ( window , mongodbUrl ) ;
149146 }
150147 if ( connectionId ) {
151148 registerConnectionIdForBrowserWindow ( window , connectionId ) ;
152149 }
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- }
159150
160151 enable ( window . webContents ) ;
161152 const unsubscribeProxyListenerPromise = compassApp . setupProxySupport (
You can’t perform that action at this time.
0 commit comments