File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 2020 "showBareErrors" : false
2121 }
2222 },
23+ "openDevTools" : true ,
24+ "simulateOutage" : false ,
25+ "clearCache" : false ,
2326 "appendSwitch" : {
2427 "--disable-pinch" : " " ,
2528 "--disable-touch-adjustment" : " " ,
Original file line number Diff line number Diff line change @@ -29,6 +29,22 @@ function createWindow () {
2929
3030 { { #isEnabled plugins 'standard-settings' } }
3131 options = require ( 'assignment' ) ( options , global . settings . window )
32+ if ( global . settings . simulateOutage ) {
33+ mainWindow . webContents . session . enableNetworkEmulation ( { offline : true } )
34+ }
35+ if ( global . settings . openDevTools ) {
36+ mainWindow . webContents . openDevTools ( )
37+ }
38+ if ( global . settings . clearCache ) {
39+ console . warn ( '⚠️ - Option to clear cache set, cache will be cleared' )
40+ store . clear ( )
41+ mainWindow . webContents . session . clearStorageData ( { } , ( ) => {
42+ mainWindow . webContents . session . clearCache ( ( ) => {
43+ console . log ( 'cache cleared.' )
44+ mainWindow . loadURL ( winURL )
45+ } )
46+ } )
47+ }
3248 { { / i s E n a b l e d } }
3349 mainWindow = new BrowserWindow ( options )
3450
You can’t perform that action at this time.
0 commit comments