@@ -30,7 +30,6 @@ import {
30
30
app ,
31
31
BrowserWindow ,
32
32
BrowserWindowConstructorOptions ,
33
- session ,
34
33
WindowOpenHandlerResponse
35
34
} from 'electron'
36
35
import { gameManagerMap } from '../index'
@@ -146,16 +145,14 @@ const openNewBrowserGameWindow = async (
146
145
const hpOverlay = await getHpOverlay ( )
147
146
148
147
return new Promise ( ( res ) => {
149
- const partition = `persist:${ appName } `
150
148
const browserGame = new BrowserWindow ( {
151
149
icon : icon ,
152
150
fullscreen : true ,
153
151
webPreferences : {
154
152
webviewTag : true ,
155
153
contextIsolation : true ,
156
154
nodeIntegration : true ,
157
- preload : path . join ( __dirname , '../preload/preload.js' ) ,
158
- partition
155
+ preload : path . join ( __dirname , '../preload/preload.js' )
159
156
} ,
160
157
show : false
161
158
} )
@@ -218,19 +215,6 @@ const openNewBrowserGameWindow = async (
218
215
}
219
216
app . on ( 'web-contents-created' , interceptFullscreenKeyInput )
220
217
221
- // Clear cache on launch to avoid issues with game updates
222
- const gameSession = session . fromPartition ( partition )
223
- gameSession . clearCache ( )
224
- gameSession . clearStorageData ( {
225
- storages : [ 'filesystem' , 'shadercache' , 'cachestorage' ] ,
226
- quotas : [ 'temporary' , 'syncable' ]
227
- } )
228
-
229
- // Open DevTools
230
- if ( ! app . isPackaged || process . env . HP_ENABLE_DEVTOOLS === 'true' ) {
231
- browserGame . webContents . openDevTools ( )
232
- }
233
-
234
218
browserGame . loadURL ( url )
235
219
// this is electron's suggested way to prevent visual flash
236
220
// https://github.com/electron/electron/blob/main/docs/api/browser-window.md#using-the-ready-to-show-event
0 commit comments