You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

openURLInBrowser.web.js 360B

1234567891011121314
  1. // @flow
  2. /**
  3. * Opens URL in the browser.
  4. *
  5. * @param {string} url - The URL to be opened.
  6. * @param {boolean} openInNewTab - If the link should be opened in a new tab.
  7. * @returns {void}
  8. */
  9. export function openURLInBrowser(url: string, openInNewTab?: boolean) {
  10. const target = openInNewTab ? '_blank' : '';
  11. window.open(url, target, 'noopener');
  12. }