Skip to content

Commit 9e8c3a3

Browse files
committed
[DDW-1213] Fix some TypeScript errors
1 parent 6a3946f commit 9e8c3a3

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

source/main/index.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ if (isBlankScreenFixActive) {
8282
// (1/2) this line increases the limit for the main process
8383
EventEmitter.defaultMaxListeners = 100; // Default: 10
8484

85-
app.allowRendererProcessReuse = true;
86-
8785
const 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

source/main/windows/main.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff 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
};

0 commit comments

Comments
 (0)