From 8da0d884ed435f4587002a8e63da0fa447f5cf50 Mon Sep 17 00:00:00 2001 From: Kevin D Date: Wed, 23 Sep 2026 12:51:21 -0700 Subject: [PATCH] console fix 1 --- banner.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/banner.js b/banner.js index fa09c10..aef0950 100644 --- a/banner.js +++ b/banner.js @@ -4,6 +4,7 @@ // incrementversion DISMISSED_KEY const DISMISSED_KEY = 'jf-banner-dismissed-v1'; const BANNER_ID = 'custom-announcement-banner'; + const SCRIPT_START = Date.now(); // Edit these to change banner content: const BANNER_HTML = ` @@ -100,7 +101,10 @@ offsetElements.add(el); }); - if (offsetPx > 0 && candidates.size === 0) { + // Jellyfin's SPA mounts its header asynchronously after DOMContentLoaded, + // so an empty result in the first few seconds is expected, not a bug. + // Only warn once things have had time to settle. + if (offsetPx > 0 && candidates.size === 0 && Date.now() - SCRIPT_START > 4000) { console.warn('[custom-banner] No fixed top navigation elements detected to push down; banner may overlap the menu.'); } }