mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-24 07:55:07 +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)
|
// Open external links in link handler registered on OS (e.g. browser)
|
||||||
win.webContents.setWindowOpenHandler(async ({ url }) => {
|
win.webContents.setWindowOpenHandler(async ({ url }) => {
|
||||||
const shouldOpen = { response: 0 };
|
let shouldOpen = { response: 0 };
|
||||||
|
|
||||||
if (!url.startsWith('http://')) {
|
if (!url.startsWith(store.get('hostURL'))) {
|
||||||
// Confirm before opening non-HTTP links
|
// 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}`;
|
const confirmNotice = `Do you want to open this link? It will be handled by an external application.\n\n${url}`;
|
||||||
shouldOpen = await dialog.showMessageBox({
|
shouldOpen = await dialog.showMessageBox({
|
||||||
type: 'question',
|
type: 'question',
|
||||||
|
|
Loading…
Reference in a new issue