package cef import ( "context" "fmt" "strings" "sync" "github.com/bnema/dumber/internal/infrastructure/webutil" "github.com/bnema/dumber/internal/application/port" "github.com/bnema/dumber/internal/logging" ) // Compile-time interface check. var _ port.ContentInjector = (*contentInjector)(nil) // scrollbarCSS styles the scrollbar with auto-hide behavior: invisible by // default, fades in on scroll, widens on hover, fades out after 1s idle. // Uses --primary theme color for the thumb. const scrollbarCSS = ` ::-webkit-scrollbar { width: 6px; height: 6px; } ::-webkit-scrollbar-track { background: transparent; } ::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; } .dumber-scrolling ::-webkit-scrollbar-thumb { background: var(--primary, rgba(128, 128, 128, 0.4)); } .dumber-scrolling ::-webkit-scrollbar:hover { width: 10px; height: 10px; } .dumber-scrolling ::-webkit-scrollbar-track:hover { background: rgba(128, 128, 128, 0.1); } .dumber-scrolling ::-webkit-scrollbar-thumb:hover { background: var(--primary, rgba(128, 128, 128, 0.6)); } ::-webkit-scrollbar-corner { background: transparent; } ` // scrollbarAutoHideJS adds/removes the .dumber-scrolling class on // on scroll activity, with a 1s fade-out timeout after scrolling stops. const scrollbarAutoHideJS = `(function(){ var t, el = document.documentElement; function show() { el.classList.add('dumber-scrolling'); clearTimeout(t); t = setTimeout(function(){ el.classList.remove('dumber-scrolling'); }, 1000); } window.addEventListener('scroll', show, {passive:true,capture:true}); window.addEventListener('wheel', show, {passive:true}); el.addEventListener('mouseenter', function(){ if(el.scrollHeight > el.clientHeight) show(); }); })();` // videoDiagnosticJS monitors all