Connection
Base URL, credentials and a reachable server.
Return keyboard focus when a browser dialog closes. Check the case where its opener has been removed and keep the remaining page usable without a mouse.
Base URL, credentials and a reachable server.
A model available through the configured endpoint.
Context limits and tool support are determined by the model and server.
const previousFocus = document.activeElement;
dialog.showModal();
dialog.addEventListener('close', () => {
if (previousFocus instanceof HTMLElement &&
previousFocus.isConnected) previousFocus.focus();
}, { once: true });