ChemPal Documentation - v1.7.0
    Preparing search index...

    Function openTab

    • Opens a URL in a new browser tab, using chrome.tabs.create inside the extension and falling back to window.open elsewhere.

      Parameters

      • url: string

        The URL to open.

      Returns void

      Nothing.

      openTab(buildGithubUrl(diag));
      
      export function openTab(url: string): void {
      if (typeof chrome?.tabs?.create === 'function') {
      chrome.tabs.create({ url });
      } else {
      window.open(url, '_blank', 'noopener');
      }
      }