From 6e670c8a727e392c400008e8cca33cc74fb5b745 Mon Sep 17 00:00:00 2001 From: iris Date: Wed, 3 Jun 2026 17:37:57 +0200 Subject: [PATCH] fix(#1157): add viewport meta to all pages; use clientWidth for side panel Without a viewport meta tag, some browsers (notably Firefox with Fingerprinting Protection active) internally read screen.availWidth / screen.availHeight to compute the default viewport size, producing the console warning 'Fingerprinting Protection is altering screen.availWidth and screen.availHeight'. Fix: - Add to all five pages that were missing it (dashboard index/flow/logs, agent index/stats). screen.html already had it. - Replace window.innerWidth with document.documentElement.clientWidth in the side-panel drag-resize code in common.js. clientWidth returns the actual CSS layout viewport width and is not rounded by Firefox's Fingerprinting Protection, making the drag calculation correct even with privacy.resistFingerprinting enabled. --- frontend/packages/agent/src/index.html | 1 + frontend/packages/agent/src/stats.html | 1 + frontend/packages/dashboard/src/common.js | 8 ++++++-- frontend/packages/dashboard/src/flow.html | 1 + frontend/packages/dashboard/src/index.html | 1 + frontend/packages/dashboard/src/logs.html | 1 + 6 files changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/packages/agent/src/index.html b/frontend/packages/agent/src/index.html index e0a79928..f66045a3 100644 --- a/frontend/packages/agent/src/index.html +++ b/frontend/packages/agent/src/index.html @@ -2,6 +2,7 @@ + hyperhive agent diff --git a/frontend/packages/agent/src/stats.html b/frontend/packages/agent/src/stats.html index 566c5c16..1ce7c065 100644 --- a/frontend/packages/agent/src/stats.html +++ b/frontend/packages/agent/src/stats.html @@ -2,6 +2,7 @@ + hyperhive agent — stats diff --git a/frontend/packages/dashboard/src/common.js b/frontend/packages/dashboard/src/common.js index 22f15719..1f71925b 100644 --- a/frontend/packages/dashboard/src/common.js +++ b/frontend/packages/dashboard/src/common.js @@ -298,7 +298,11 @@ export const Panel = (() => { const WIDTH_KEY = 'hyperhive:side-panel-width'; const WIDTH_MIN = 320; function clampWidth(w) { - const max = Math.floor(window.innerWidth * 0.96); + // Use document.documentElement.clientWidth rather than window.innerWidth: + // clientWidth gives the actual CSS layout viewport width and is not + // altered by Firefox's Fingerprinting Protection (which rounds + // window.innerWidth/outerWidth to the nearest 200px). + const max = Math.floor(document.documentElement.clientWidth * 0.96); return Math.max(WIDTH_MIN, Math.min(max, w)); } function applyStoredWidth() { @@ -334,7 +338,7 @@ export const Panel = (() => { document.addEventListener('pointermove', (e) => { if (!dragging) return; // Drawer is anchored to the right edge — width = viewport - pointer X. - const w = clampWidth(window.innerWidth - e.clientX); + const w = clampWidth(document.documentElement.clientWidth - e.clientX); drawer.style.setProperty('--side-panel-w', w + 'px'); }); function stopDrag() { diff --git a/frontend/packages/dashboard/src/flow.html b/frontend/packages/dashboard/src/flow.html index 2fc6723c..aca98872 100644 --- a/frontend/packages/dashboard/src/flow.html +++ b/frontend/packages/dashboard/src/flow.html @@ -2,6 +2,7 @@ + hyperhive // FL0W diff --git a/frontend/packages/dashboard/src/index.html b/frontend/packages/dashboard/src/index.html index ae8f2196..6584ea29 100644 --- a/frontend/packages/dashboard/src/index.html +++ b/frontend/packages/dashboard/src/index.html @@ -2,6 +2,7 @@ + hyperhive // h1ve-c0re diff --git a/frontend/packages/dashboard/src/logs.html b/frontend/packages/dashboard/src/logs.html index ae0f9f70..2a4ad7c3 100644 --- a/frontend/packages/dashboard/src/logs.html +++ b/frontend/packages/dashboard/src/logs.html @@ -2,6 +2,7 @@ + hyperhive // LOGS