Closed jackschedel closed 1 year ago
The top answer there is a bit outdated (2015).
While require("shell").openExternal("http://www.google.com")
would work fine, it could also be annoying to set up with unknown URLs (links in chat messages) and in multiple places.
There is an electron setting, in the webPreferences
parameter of the Electron function createWindow
to open externally by default. The new code here might be something like:
win = new BrowserWindow({
autoHideMenuBar: true,
show: false,
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
nativeWindowOpen: true // set to true to open links externally by default
}
});
@cheeseonamonkey thanks for the info. I've been really busy lately so I haven't been updating the app as much and wouldn't have gotten around to it in a while, so your comment definitely sped things up by a few weeks xD.
The change should be live on the latest release. https://github.com/jackschedel/gpt.koaladev.io/releases/tag/4cd8e6175cd804021c154f6da702cef2cc5fede8-5306093363 (I won't be able to verify that it works as intended until Monday tho)
Next time, feel free to submit a PR too.
@jackschedel The original repo is a mess, and I like your improvements :)
I have a couple more bugs in mind too, but I want to familiarize myself with Svelte first
https://stackoverflow.com/questions/31749625/make-a-link-from-electron-open-in-browser