Skip to content

Commit d36fa4c

Browse files
committed
fix(App): Add security check before opening new window
1 parent 68226bd commit d36fa4c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/models/ServiceBrowserView.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { buildMenuTpl } from '../electron/serviceContextMenuTemplate';
1212
import { IPC } from '../features/todos/constants';
1313
import { getRecipeDirectory, loadRecipeConfig } from '../helpers/recipe-helpers';
1414
import { isMac } from '../environment';
15+
import { isValidExternalURL } from '../helpers/url-helpers';
1516

1617
const debug = require('debug')('Franz:Models:ServiceBrowserView');
1718

@@ -252,7 +253,9 @@ export class ServiceBrowserView {
252253
} else if (disposition === 'background-tab' || disposition === 'foreground-tab') {
253254
action = 'deny';
254255

255-
shell.openExternal(url);
256+
if (isValidExternalURL(url)) {
257+
shell.openExternal(url);
258+
}
256259
}
257260

258261
return {

0 commit comments

Comments
 (0)