init function

Last updated: 2026-03-05T23:41:17.506Z

Metrics

LOC: 19 Complexity: 3 Params: 0

Signature

init(): : Promise<void>

Source Code

async function init(): Promise<void> {
  const settings = (await chrome.runtime.sendMessage({
    type: "GET_SETTINGS",
  })) as { uiLanguage?: "auto" | "en" | "pt_BR" } | null;
  await initI18n(settings?.uiLanguage ?? "auto");

  // Sync watcher state from content script
  const watcherStatus = (await sendToPage({ type: "GET_WATCHER_STATUS" }).catch(
    () => null,
  )) as { watching: boolean } | null;
  panelState.watcherActive = watcherStatus?.watching ?? false;

  // Inject log viewer styles
  const lvStyle = document.createElement("style");
  lvStyle.textContent = getLogViewerStyles("devtools");
  document.head.appendChild(lvStyle);

  renderApp();
}

Dependencies (Outgoing)

graph LR init["init"] sendToPage["sendToPage"] renderApp["renderApp"] init -->|calls| sendToPage init -->|calls| renderApp style init fill:#dbeafe,stroke:#2563eb,stroke-width:2px click init "13c941f8edb316e8.html" click sendToPage "c08387d99fb8cee4.html" click renderApp "b94036094eefb024.html"
TargetType
sendToPage calls
renderApp calls

No incoming dependencies.