refactor: 💡 Allow external links just for specific domain

Allow external links just for boundary.io domain. So far the only urls
we want to open externally are our own documentation
This commit is contained in:
Carlos Alcaide committed 2021-07-26 13:09:08 -07:00
1 parent 7bd8d87ad2
commit a07cd9e1a1
1 file changed
+3 -2
+3 -2
View File
@@ -167,10 +167,11 @@ app.on('ready', async () => {
/* eng-disable LIMIT_NAVIGATION_JS_CHECK */
if (!url.startsWith('serve://boundary')) event.preventDefault();
});
// Also opens links with target="_blank" in a browser window
// Opens external links in the host default browser.
// We just allow boundaryproject.io domain to open on external window (for now).
mainWindow.webContents.on('new-window', (event, url) => {
/* eng-disable LIMIT_NAVIGATION_JS_CHECK */
if (!url.startsWith('serve://boundary')) {
if (url.startsWith('https://boundaryproject.io/')) {
event.preventDefault();
shell.openExternal(url);
}