Skip to content

Commit

Permalink
fix(App): Add security check before opening new window
Browse files Browse the repository at this point in the history
  • Loading branch information
adlk committed Mar 31, 2022
1 parent 68226bd commit d36fa4c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/models/ServiceBrowserView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { buildMenuTpl } from '../electron/serviceContextMenuTemplate';
import { IPC } from '../features/todos/constants';
import { getRecipeDirectory, loadRecipeConfig } from '../helpers/recipe-helpers';
import { isMac } from '../environment';
import { isValidExternalURL } from '../helpers/url-helpers';

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

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

shell.openExternal(url);
if (isValidExternalURL(url)) {
shell.openExternal(url);
}
}

return {
Expand Down

0 comments on commit d36fa4c

Please sign in to comment.