initLogTab function exported
Last updated: 2026-03-01T23:25:47.138Z
Location
Metrics
LOC: 28
Complexity: 4
Params: 0
Signature
initLogTab(): : void
Source Code
export function initLogTab(): void {
// Inject log viewer styles once
const style = document.createElement("style");
style.textContent = getLogViewerStyles("options");
document.head.appendChild(style);
// Observe when the log tab becomes visible to init the viewer
const tabContent = document.getElementById("tab-log");
if (!tabContent) return;
const observer = new MutationObserver(() => {
if (tabContent.classList.contains("active")) {
setupViewer();
observer.disconnect();
}
});
observer.observe(tabContent, {
attributes: true,
attributeFilter: ["class"],
});
// Also check if already active (e.g. deep link)
if (tabContent.classList.contains("active")) {
setupViewer();
observer.disconnect();
}
}
Dependencies (Outgoing)
| Target | Type |
|---|---|
| LogViewer | uses |
| createLogViewer | uses |
| getLogViewerStyles | uses |
| setupViewer | calls |
Impact (Incoming)
| Source | Type |
|---|---|
| main | calls |