Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

613 B
Raw Blame
/**
 * Opens `url` in a new tab the way a `target="_blank"` link does, without giving the new page an
 * opener or a referrer. Call it synchronously inside the user's click: `window.open` with a
 * `noopener,noreferrer` features string asks WebKit for a popup window, which Safari opens as a
 * separate window and an iOS home-screen web app does not open at all.
 */
export function openInNewTab(url: string): void {
  const link = document.createElement('a');
  link.href = url;
  link.target = '_blank';
  link.rel = 'noopener noreferrer';
  document.body.appendChild(link);
  link.click();
  link.remove();
}