Skip to content

Commit

Permalink
fix(app): open external links in browser (#14447)
Browse files Browse the repository at this point in the history
external links were opening in the electron browser window instead of an external browser window

closes RQA-2309
  • Loading branch information
shlokamin authored Feb 7, 2024
1 parent b8a60d6 commit 17963c0
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions app-shell/src/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,10 @@ export function createUi(): BrowserWindow {
mainWindow.loadURL(url, { extraHeaders: 'pragma: no-cache\n' })

// open new windows (<a target="_blank" ...) in browser windows
mainWindow.webContents.setWindowOpenHandler(({ url, disposition }) => {
if (disposition === 'new-window' && url === 'about:blank') {
// eslint-disable-next-line no-void
void shell.openExternal(url)
return { action: 'deny' }
} else {
return { action: 'allow' }
}
mainWindow.webContents.setWindowOpenHandler(({ url }) => {

Check warning on line 60 in app-shell/src/ui.ts

View check run for this annotation

Codecov / codecov/patch

app-shell/src/ui.ts#L60

Added line #L60 was not covered by tests
// eslint-disable-next-line no-void
void shell.openExternal(url)
return { action: 'deny' }

Check warning on line 63 in app-shell/src/ui.ts

View check run for this annotation

Codecov / codecov/patch

app-shell/src/ui.ts#L62-L63

Added lines #L62 - L63 were not covered by tests
})

return mainWindow
Expand Down

0 comments on commit 17963c0

Please sign in to comment.