Skip to content

Re-sync https://github.com/ryanbr/TwitchAdSolutions/releases/tag/v68.4.0 - #330

Merged
ryanbr merged 3 commits into
masterfrom
dffdsdfsdfs
Jun 20, 2026
Merged

Re-sync https://github.com/ryanbr/TwitchAdSolutions/releases/tag/v68.4.0#330
ryanbr merged 3 commits into
masterfrom
dffdsdfsdfs

Conversation

@ryanbr

@ryanbr ryanbr commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

@ryanbr
ryanbr requested a review from griffinallen June 8, 2026 02:06

@griffinallen griffinallen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@github-actions

Copy link
Copy Markdown

[puLL-Merge] - brave/adblock-resources@330

Description

Version bump and behavioral fixes for Twitch ad-blocking scripts (vaft-ublock-origin.js v84→v85) and regenerated dist/resources.json.

Key changes:

  1. Post-ad re-entry guard for snapshot replay: prevents stale clean-playlist snapshots from being replayed when a consecutive ad break starts within 8s of the previous reload.
  2. iOS/iPadOS soft-reload downgrade: detects Apple touch devices and downgrades hard reloads to soft reloads to preserve the user-gesture-blessed media element, avoiding black-screen + play-icon stalls.
  3. Hidden-tab backoff exception during ad breaks: stops throttling the buffer monitor poll rate (3× slower) while an ad break is active on a backgrounded tab, preventing "stuck loading until refocus" stalls.

Security Hotspots

  1. isAppleTouchDevice detection via navigator.platform/navigator.maxTouchPoints — purely informational client-side check, no data exfiltration. Low risk.
Changes

Changes

resources/vaft-ublock-origin.js

  • Version bump 84 → 85
  • stripAdSegments: added recentReloadReentry guard — skips snapshot replay if LastPlayerReload was <8s ago
  • New isAppleTouchDevice IIFE — detects iPhone/iPad/iPod or iPadOS 13+ (MacIntel + touch)
  • New iosSoftReload flag — reads twitchAdSolutions_iosSoftReload from localStorage, defaults true on Apple touch
  • doTwitchPlayerTask: hardReload now ANDs with !iosSoftReload; logs downgrade when active
  • monitorPlayerBuffering: shouldThrottle condition now includes && !playerBufferState.inAdBreak

dist/resources.json

  • Regenerated single-line JSON containing all base64-encoded resources including updated vaft-ublock-origin.js
sequenceDiagram
    participant Worker as IVS Worker
    participant Main as Main Thread
    participant Player as Twitch Player

    Note over Worker: Ad break detected in m3u8
    Worker->>Worker: stripAdSegments() — all segments stripped
    alt recentReloadReentry (< 8s since last reload)
        Worker->>Worker: Skip snapshot replay, use recovery cache
    else snapshot fresh & clean
        Worker->>Worker: Replay LastCleanNativeM3U8
    end
    Worker->>Main: postMessage({key: 'ReloadPlayer', kind: 'early'})
    Main->>Main: doTwitchPlayerTask(false, true, 'early')
    alt isAppleTouchDevice && iosSoftReload
        Main->>Main: Downgrade to soft reload (hardReload=false)
        Main->>Player: setSrc({isNewMediaPlayerInstance: false})
    else Desktop / opt-out
        Main->>Main: Hard reload
        Main->>Player: setSrc({isNewMediaPlayerInstance: true})
    end
Loading

@ryanbr
ryanbr merged commit 61ebe7f into master Jun 20, 2026
5 checks passed
@ryanbr
ryanbr deleted the dffdsdfsdfs branch June 20, 2026 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants