mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 23:48:56 +01:00
Fix opening external links from confirmation dialog box on desktop app
This commit is contained in:
parent
3abe7ccb26
commit
1aeea3d854
1 changed files with 3 additions and 3 deletions
|
@ -384,10 +384,10 @@ const createWindow = (tab = 'chat.html') => {
|
|||
|
||||
// Open external links in link handler registered on OS (e.g. browser)
|
||||
win.webContents.setWindowOpenHandler(async ({ url }) => {
|
||||
const shouldOpen = { response: 0 };
|
||||
let shouldOpen = { response: 0 };
|
||||
|
||||
if (!url.startsWith('http://')) {
|
||||
// Confirm before opening non-HTTP links
|
||||
if (!url.startsWith(store.get('hostURL'))) {
|
||||
// Confirm before opening external links
|
||||
const confirmNotice = `Do you want to open this link? It will be handled by an external application.\n\n${url}`;
|
||||
shouldOpen = await dialog.showMessageBox({
|
||||
type: 'question',
|
||||
|
|
Loading…
Reference in a new issue