Commit Graph
7 Commits
Author SHA1 Message Date
robot bd093be652 refactor(viewer): modularize HLS playback tracking with per-panel state machine
CI / test (pull_request) Successful in 27s
Decompose monolithic wirePlaybackTracking() into single-responsibility modules:

- PanelState: per-panel playback state (phase, segments, buffer, quality)
- EventWiring: attaches hls.js + video element event listeners
- BufferMonitor: periodic buffer health check with timer lifecycle
- PanelRenderer: per-panel overlay rendering (phase, quality, segments)
- AggregateRenderer: global status bar aggregating all panel states
- PanelFactory: DOM panel creation + HLS/direct playback routing

Each module handles one concern: state tracking, event registration,
buffer monitoring, overlay rendering, aggregate rendering, or DOM creation.

Also fix: walk() dead code bug in m3u8DeepProbeFn where the string check
was unreachable behind the object-type guard.
2026-08-12 13:43:42 +00:00
robot a128babde0 fix: run deep probe and scraper in MAIN world for access to page globals
CI / test (pull_request) Successful in 24s
The root cause of repeated 'does not detect any videos' failures was that
m3u8DeepProbeFn and scrapeFn were injected via chrome.scripting.executeScript
in the isolated world (default). From the isolated world:

- window.__goon_plugin_data (set by main-world interceptors) — NOT visible
- window.Hls / Hls.cast (page's hls.js) — NOT visible
- Player globals (PHPlayer, flowplayer, etc.) — NOT visible
- Config globals (__NEXT_DATA__, appData, etc.) — NOT visible

Only DOM properties like video._goon_hls_manifest cross the boundary, making
the detection pipeline mostly blind on real HLS sites.

Fix: set world: 'MAIN' on both executeScript calls so all 6 deep probe
strategies and all 5 scrape priorities actually work. Chrome MV3 supports
this since Chrome 108; our build targets chrome110.
2026-08-12 11:11:06 +00:00
robot 11e697915e fix(viewer): fallback to src as HLS manifest when hlsManifest is missing
CI / test (pull_request) Successful in 19s
When mediaType=hls but hlsManifest field is absent (e.g. lost during
storage serialization), fall back to src if it looks like a manifest URL
(.m3u8 with http scheme). This prevents the video from silently failing
to play on Chrome where there is no native HLS support.
2026-08-12 08:59:11 +00:00
robot 02498f2694 fix: lint cleanup — JSON import compat, unused vars, HLS_CONFIG freeze
CI / test (pull_request) Successful in 15s
- Replace 'import ... with { type: "json" }' with fs-based JSON.parse
  (ESLint espree cannot parse JSON import attributes)
- Prefix unused catch-clause variables with _ (e -> _e)
- Prefix unused hls.js event data params with _ (data -> _data)
- Freeze HLS_CONFIG with Object.freeze for defensive immutability

Lint: 0 errors (3 cosmetic _e warnings in catch blocks)
Tests: 44/44 passed
Build: 9 modules, 201ms
2026-08-12 07:18:05 +00:00
robot fe1949acf3 fix: refactor HLS detection pipeline to restore dropped strategies
- Add Strategy E to m3u8DeepProbeFn: read __goon_plugin_data.manifests
  from main-world interceptors (was accidentally dropped during refactoring)
- Re-add content script query in scanVideos: restores poster URL extraction
  (og:image, twitter:image) and secondary manifest source from content.js
- Extend interceptor Hls.js polling from 3s to 30s + add MutationObserver
  fallback for dynamically-loaded players
- Restore allFrames:true in scrapeTab: catches iframe-hosted video players
  (e.g. Pornhub embeds player in nested iframes)
- Prefer interceptor-collected manifests over inline-script scraps in
  both dedupManifests sort order and scrapeFn Priority 5 fallback
2026-08-12 04:47:47 +00:00
robot 88585a29bf fix: disable modulePreload polyfill for Chrome MV3 compatibility
CI / test (pull_request) Successful in 18s
Vite was injecting modulepreload-polyfill.js into the built output, which
Chrome rejected at runtime with: 'A preload for .../modulepreload-polyfill.js
is found, but is not used because it is a cross-world extension resource
mismatch.'

Disabling the polyfill (extension context does not need it — Chrome 110+
supports bare ESM natively) removes the offending chunk entirely.
2026-08-12 03:13:07 +00:00
robot c59c96ce19 fix: integrate child task improvements (poster rendering, HLS cleanup, hls.js dependency)
CI / test (pull_request) Canceled after 0s
2026-08-10 22:42:48 +00:00