Skip to content

Add React tree fallback discovery for obfuscation resilience#56

Open
ryanbr wants to merge 2 commits intomasterfrom
feat/react-fallback-discovery
Open

Add React tree fallback discovery for obfuscation resilience#56
ryanbr wants to merge 2 commits intomasterfrom
feat/react-fallback-discovery

Conversation

@ryanbr
Copy link
Copy Markdown
Owner

@ryanbr ryanbr commented Apr 7, 2026

If Twitch obfuscates their React internals, the primary named-property lookups (setPlayerActive, mediaPlayerInstance, setInitialPlaybackSettings) would fail. Adds three fallback layers:

  1. Root node: also check __reactFiber prefix (React 18 variants)
  2. Player: structural match via getHTMLVideoElement + getBufferDuration
    • core.state (these are player API methods unlikely to be renamed)
  3. PlayerState: fallback via setSrc + setStreamManagerNode if setInitialPlaybackSettings is renamed

Primary lookups run first — fallbacks only fire if primary fails. Zero overhead when primary succeeds (fallback not evaluated).

ryanbr and others added 2 commits April 7, 2026 12:37
If Twitch obfuscates their React internals, the primary named-property
lookups (setPlayerActive, mediaPlayerInstance, setInitialPlaybackSettings)
would fail. Adds three fallback layers:

1. Root node: also check __reactFiber prefix (React 18 variants)
2. Player: structural match via getHTMLVideoElement + getBufferDuration
   + core.state (these are player API methods unlikely to be renamed)
3. PlayerState: fallback via setSrc + setStreamManagerNode if
   setInitialPlaybackSettings is renamed

Primary lookups run first — fallbacks only fire if primary fails.
Zero overhead when primary succeeds (fallback not evaluated).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant