From a3845bf429f127163d0d8bf320f690bf5bcd15d4 Mon Sep 17 00:00:00 2001 From: user01 Date: Sun, 14 Jun 2026 17:14:17 +0900 Subject: [PATCH] =?UTF-8?q?document.hidden=20=EA=B0=95=EC=A0=9C=20false?= =?UTF-8?q?=EB=A1=9C=20=EB=B0=B1=EA=B7=B8=EB=9D=BC=EC=9A=B4=EB=93=9C=20?= =?UTF-8?q?=ED=83=AD=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EB=A1=9C=EB=94=A9=20?= =?UTF-8?q?=EB=B3=B4=EA=B0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - document.hidden, document.visibilityState 강제 오버라이드 (페이지의 lazy loading 코드가 탭 상태를 확인해도 항상 visible) - IntersectionObserver 후킹 유지 (observe 즉시 콜백) - 두 조치로 백그라운드 탭에서도 일반 탭처럼 IO + 이미지 로딩 동작 --- tokimonkeyDownader.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tokimonkeyDownader.js b/tokimonkeyDownader.js index 0628f80..126854b 100644 --- a/tokimonkeyDownader.js +++ b/tokimonkeyDownader.js @@ -24,6 +24,20 @@ // Phase 1: IntersectionObserver 후킹 (document-start 에서 즉시 실행) // 백그라운드 탭에서 IO가 동작하지 않아도 observe() 즉시 콜백 실행 // --------------------------------------------------------------- + // document.hidden 강제 false (배경 탭에서도 페이지가 활성화된 것으로 인식) + try { + Object.defineProperty(document, 'hidden', { get: () => false, configurable: true }); + Object.defineProperty(document, 'visibilityState', { get: () => 'visible', configurable: true }); + } catch (_) {} + try { + const proto = Document.prototype; + if (proto) { + Object.defineProperty(proto, 'hidden', { get: () => false, configurable: true }); + Object.defineProperty(proto, 'visibilityState', { get: () => 'visible', configurable: true }); + } + } catch (_) {} + + // IntersectionObserver 후킹: observe() 즉시 콜백 실행 const OrigIO = window.IntersectionObserver; if (OrigIO) { const HookedIO = function (callback, options) {