diff --git a/skill/scripts/live-browser.js b/skill/scripts/live-browser.js index 3cbdaceb1..bc71d8e5a 100644 --- a/skill/scripts/live-browser.js +++ b/skill/scripts/live-browser.js @@ -152,6 +152,7 @@ let scrollLockTargetY = null; let scrollLockRaf = null; let scrollLockAbort = null; + const SCROLL_ANCHOR_LOCK_ID = 'impeccable-scroll-anchor-lock'; // Dedicated key for scroll position - SEPARATE from LS_KEY so that // saveSession's state updates don't clobber a carefully-captured scrollY. @@ -5815,10 +5816,22 @@ try { history.scrollRestoration = 'manual'; } catch {} - const prevHtmlAnchor = document.documentElement.style.overflowAnchor; - const prevBodyAnchor = document.body.style.overflowAnchor; - document.documentElement.style.overflowAnchor = 'none'; - document.body.style.overflowAnchor = 'none'; + // Suppress the browser's scroll-anchoring on the scroll root so it can't + // fight our manual scroll correction. Apply this as a stylesheet rule, not + // as inline `style` on /: those elements are server-rendered by + // frameworks like Next.js App Router, and mutating their inline style makes + // React 19 report a hydration mismatch on the next Fast-Refresh re-render. + // A