2019-10-11 18:09:50 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Opens URL in the browser.
|
|
|
|
*
|
|
|
|
* @param {string} url - The URL to be opened.
|
2020-05-14 12:30:24 +00:00
|
|
|
* @param {boolean} openInNewTab - If the link should be opened in a new tab.
|
2019-10-11 18:09:50 +00:00
|
|
|
* @returns {void}
|
|
|
|
*/
|
2020-05-14 12:30:24 +00:00
|
|
|
export function openURLInBrowser(url: string, openInNewTab?: boolean) {
|
|
|
|
const target = openInNewTab ? '_blank' : '';
|
|
|
|
|
|
|
|
window.open(url, target, 'noopener');
|
2019-10-11 18:09:50 +00:00
|
|
|
}
|