File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -82,8 +82,6 @@ if (isBlankScreenFixActive) {
8282// (1/2) this line increases the limit for the main process
8383EventEmitter . defaultMaxListeners = 100 ; // Default: 10
8484
85- app . allowRendererProcessReuse = true ;
86-
8785const safeExit = async ( ) => {
8886 pauseActiveDownloads ( ) ;
8987
@@ -253,15 +251,16 @@ const onAppReady = async () => {
253251 // Security feature: Prevent creation of new browser windows
254252 // https://github.com/electron/electron/blob/master/docs/tutorial/security.md#14-disable-or-limit-creation-of-new-windows
255253 app . on ( 'web-contents-created' , ( _ , contents ) => {
256- contents . on ( 'new-window' , ( event , url ) => {
257- // Prevent creation of new BrowserWindows via links / window.open
258- event . preventDefault ( ) ;
254+ contents . setWindowOpenHandler ( ( details ) => {
255+ const { url } = details ;
259256 // @ts -ignore ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
260257 logger . info ( 'Prevented creation of new browser window' , {
261258 url,
262259 } ) ;
263260 // Open these links with the default browser
264261 shell . openExternal ( url ) ;
262+ // Prevent creation of new BrowserWindows via links / window.open
263+ return { action : 'deny' } ;
265264 } ) ;
266265 } ) ;
267266 // Wait for controlled cardano-node shutdown before quitting the app
Original file line number Diff line number Diff line change @@ -48,14 +48,13 @@ export const createMainWindow = (
4848 height : 870 ,
4949 ...getSavedWindowBounds ( ) ,
5050 webPreferences : {
51- nodeIntegration : isTest ,
51+ nodeIntegration : true ,
5252 webviewTag : false ,
5353 // @ts -ignore ts-migrate(2322) FIXME: Type '{ nodeIntegration: boolean; webviewTag: fals... Remove this comment to see the full error message
5454 contextIsolation : false ,
5555 // TODO: change to ipc
5656 enableRemoteModule : isTest ,
5757 preload : path . join ( __dirname , './preload.js' ) ,
58- nodeIntegration : true ,
5958 additionalArguments : isBlankScreenFixActive ? [ '--safe-mode' ] : [ ] ,
6059 } ,
6160 } ;
You can’t perform that action at this time.
0 commit comments