openInNewWindow function

void openInNewWindow(
  1. String url
)

Opens the given url in a new window.

Gives a hint to Chrome that it should open the given link in a separate process.

Implementation

void openInNewWindow(String url) {
  var anchorElement = AnchorElement(href: url)
    ..rel = 'noopener noreferrer'
    ..target = '_blank';
  document.body!.append(anchorElement);
  anchorElement.click();
  anchorElement.remove();
}