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) {