diff --git a/app-shell/src/ui.js b/app-shell/src/ui.js index 3b6d502c695..a7479b30f45 100644 --- a/app-shell/src/ui.js +++ b/app-shell/src/ui.js @@ -1,5 +1,5 @@ // sets up the main window ui -import {app, BrowserWindow} from 'electron' +import {app, shell, BrowserWindow} from 'electron' import path from 'path' import {getConfig} from './config' import createLogger from './log' @@ -42,5 +42,12 @@ export default function createUi () { log.info(`Loading ${url}`) mainWindow.loadURL(url, {'extraHeaders': 'pragma: no-cache\n'}) + // open new windows ( { + log.debug('Opening external link', {url}) + event.preventDefault() + shell.openExternal(url) + }) + return mainWindow } diff --git a/app/src/components/AppSettings/ReleaseNotes.js b/app/src/components/AppSettings/ReleaseNotes.js index 699da2aaba7..974749f70db 100644 --- a/app/src/components/AppSettings/ReleaseNotes.js +++ b/app/src/components/AppSettings/ReleaseNotes.js @@ -7,7 +7,10 @@ import styles from './styles.css' type Props = {source: ?string} const renderer = remark().use(reactRenderer, { - remarkReactComponents: {div: React.Fragment}, + remarkReactComponents: { + div: React.Fragment, + a: ExternalLink, + }, }) const DEFAULT_RELEASE_NOTES = 'We recommend upgrading to the latest version.' @@ -25,3 +28,7 @@ export default function ReleaseNotes (props: Props) { ) } + +function ExternalLink (props) { + return +} diff --git a/app/src/components/Resources/ResourceCard.js b/app/src/components/Resources/ResourceCard.js index efdbb768a9d..605610206da 100644 --- a/app/src/components/Resources/ResourceCard.js +++ b/app/src/components/Resources/ResourceCard.js @@ -22,6 +22,7 @@ export default function ResourceCard (props: Props) { Component="a" href={props.url} target="_blank" + rel="noopener noreferrer" className={styles.link_button} > View in Browser