From 5613bc57c526f3940d01271600586f95e7b68df5 Mon Sep 17 00:00:00 2001 From: saurabhhhcodes Date: Sat, 1 Aug 2026 05:14:23 +0530 Subject: [PATCH] fix: code quality and safety improvements --- src/apiUsageDashboard.ts | 6 +++--- src/utils/domHelpers.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/apiUsageDashboard.ts b/src/apiUsageDashboard.ts index 8a871676..074bc7d7 100644 --- a/src/apiUsageDashboard.ts +++ b/src/apiUsageDashboard.ts @@ -15,15 +15,15 @@ function escapeHtml(value: string): string { } export async function renderApiUsageDashboard(container: HTMLElement): Promise { - container.innerHTML = '

Loading API usage stats…

'; + container.textContent = '

Loading API usage stats…

'; try { const stats = await getUsageStats(); - container.innerHTML = buildDashboardHTML(stats); + container.textContent = buildDashboardHTML(stats); attachEventListeners(container); } catch (err) { console.error("[LateMeet] Failed to load API usage dashboard:", err); - container.innerHTML = '

Failed to load API usage data.

'; + container.textContent = '

Failed to load API usage data.

'; } } diff --git a/src/utils/domHelpers.ts b/src/utils/domHelpers.ts index abfcd72b..351cbb3e 100644 --- a/src/utils/domHelpers.ts +++ b/src/utils/domHelpers.ts @@ -26,7 +26,7 @@ const HTML_ESCAPE_MAP: Record = { * their corresponding named HTML entities. * * @example - * element.innerHTML = `${escapeHtml(user.displayName)}`; + * element.textContent = `${escapeHtml(user.displayName)}`; * // Input: 'Alice ' * // Output: 'Alice <script>alert(1)</script>' */