Skip to content

Commit

Permalink
🐛fix: weblinks opening in another kuro instance
Browse files Browse the repository at this point in the history
  - 🐞 fixes #81 & OSS-27
by David Morais <david@davidmorais.com>
  • Loading branch information
davidsmorais committed Jan 30, 2023
1 parent e26644e commit bea3568
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const { ipcRenderer: ipc } = require("electron");
const mode = require("./mode");
const nav = require("./nav");
const {store} = require("./settings");
const { store } = require("./settings");
const startup = require("./startup");

ipc.on("search", () => {
Expand Down Expand Up @@ -136,3 +136,11 @@ document.addEventListener("DOMContentLoaded", () => {
nav.sideBar();
mode.restore();
});

// Open links in system browser
document.addEventListener("click", event => {
if (event.target.tagName.toLowerCase() === "a") {
event.preventDefault();
require("electron").shell.openExternal(event.target.href);
}
});

0 comments on commit bea3568

Please sign in to comment.