XHR 후킹 추가: 치지직이 axios 로 부르는 live-detail 도 가로채도록 수정

문제: v1.1.0 의 fetch 후킹은 작동(`fetch hook installed` 로그 확인)했지만
실제 라이브 페이지에서 `forcing timeMachine ON` 로그가 한 번도 안 떴음.
콘솔 스택트레이스에 `XMLHttpRequest.send` 와 `xhr @ main.d2cbcc55.js` 가
반복 등장해 치지직 React 앱이 axios over XHR 로 live-detail 을 호출하는
것이 확인됨 → fetch 만 후킹한 v1.1.0 은 무용지물이었음.

수정:
- timemachine.js: XMLHttpRequest 의 open/setRequestHeader/send 를 후킹.
  live-detail URL 이면 native send 대신 우리가 fetch 로 직접 요청을
  날리고, 응답을 patchLiveDetailData 로 패치한 뒤 defineProperty 로
  readyState/status/responseText/response/responseURL 등을 덮어쓰고
  readystatechange/load/loadend 이벤트를 합성 발화. responseType
  (text/json/arraybuffer/blob) 별 response 값도 맞춰 만든다.
- fetch 후킹도 유지 (혹시 일부 경로가 fetch 쓸 수 있음).
- 로그 메시지를 `hooks installed (fetch + XHR)` 로 변경하고 XHR 진입
  지점에 `XHR live-detail intercepted for <channelId>` 진단 로그 추가.
- urlOf() 헬퍼로 string/Request/URL 입력을 일관 처리.
- manifest 버전 1.1.0 → 1.1.1.
- README 동작 방식 설명/확인 로그 갱신.
This commit is contained in:
Claude (chzzk-bypass owner)
2026-05-28 01:42:44 +09:00
parent 833f313b72
commit 7fa34bf6ea
3 changed files with 175 additions and 49 deletions

View File

@@ -20,10 +20,11 @@
동작 방식:
1. `api.chzzk.naver.com/service/vN/channels/{id}/live-detail` 응답을 `fetch`
후킹으로 가로챕니다.
2. `content.timeMachineActive` 플래그를 강제로 `true` 로 만듭니다 → 플레이어
UI 가 되감기 바를 노출합니다.
1. `api.chzzk.naver.com/service/v3.2/channels/{id}/live-detail` 응답을
`window.fetch``XMLHttpRequest` 양쪽에서 가로챕니다. 치지직 React 앱은
axios 기반이라 실제 요청이 XHR 로 나가므로 XHR 후킹이 필수입니다.
2. 응답 본문의 `content.timeMachineActive``content.timeMachinePlayback`
두 플래그를 강제로 `true` 로 만듭니다 → 플레이어 UI 가 되감기 바를 노출합니다.
3. 같은 채널의 `…/channels/{id}/live-playback-json` 을 호출해 DVR 매니페스트
문자열을 받아 `content.livePlaybackJson` 을 교체합니다 → 매니페스트가 실제
seek 을 지원하게 됩니다.
@@ -60,7 +61,8 @@ icons/ 확장 아이콘
브라우저 devtools 콘솔에서 다음 로그를 확인할 수 있습니다.
- `[chzzk-bypass:timemachine] fetch hook installed` — 후킹 성공
- `[chzzk-bypass:timemachine] hooks installed (fetch + XHR)` — 후킹 성공
- `[chzzk-bypass:timemachine] XHR live-detail intercepted for <channelId>` — XHR 가로채기 진입
- `[chzzk-bypass:timemachine] forcing timeMachine ON for <channelId>` — 패치 적용
- `[chzzk-bypass:timemachine] livePlaybackJson swapped for DVR manifest` — 매니페스트 교체 성공