Commit Graph
29 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
Hermes QA 8794218ee8 fix: viewer.js string entry handling + HLS console log for integration tests
CI / test (pull_request) Successful in 18s
- Handle string entries in createPanel (e.g. 'https://...mp4')
  instead of dropping them as null — restores legacy string URL support.
- Add console.log for HLS detection so integration tests can verify
  HLS playback paths are exercised.
2026-08-12 01:59:24 +00:00
Hermes QA 135913b86c fix: silence no-unused-vars lint warnings in interceptors.js and viewer.js
CI / test (pull_request) Failing after 16s
2026-08-12 01:39:20 +00:00
Hermes QA 15816a8579 fix: add web_accessible_resources for interceptors.js in manifest.json
CI / test (pull_request) Failing after 16s
Without this, Chrome blocks chrome.runtime.getURL('interceptors.js')
in Manifest V3, causing HLS detection to silently fail.

Added regression test to prevent future removal.
2026-08-12 01:23:05 +00:00
robot bc3f37ae4c fix: improve HLS.js video detection and playback capture
CI / test (pull_request) Failing after 16s
- Add Hls.cast(video) detection (Strategy B1) — uses the official hls.js
  API to retrieve bound instances from <video> elements
- Add _goon_hls_manifest annotation check (Strategy B2) — reads interceptor-set
  manifest URLs directly on video elements
- Refactor scrapeFn to a 5-priority HLS detection chain:
  1. Direct .m3u8 in video.src
  2. Interceptor-set _goon_hls_manifest
  3. Hls.cast(video) official API
  4. Direct HTTP source (non-blob)
  5. Deep probe fallback (page globals/scripts)
- Replace fragile Object.defineProperty Hls detection with polling interval
  in interceptors.js — avoids conflicts with page JS
- Add buffered range tracking and duration to content.js video scan data
- Add 8 new tests for HLS detection priority chain (55 total)
2026-08-12 00:49:21 +00:00
robot 7276824758 test: add config validation and viewer integration tests
CI / test (pull_request) Failing after 26s
- Config validation suite (43 tests): verify HLS grid config, manifest
  dedup, video entry normalization, storage pipeline metadata preservation
- Viewer integration tests (30 tests): panel rendering for HLS/direct
  entries, edge cases (empty manifests, missing fields, mixed grids)
- Tests mirror current pipeline functions (not outdated code)
2026-08-12 00:20:36 +00:00
robot d86c1d1778 feat: add HLS deep-probe scanning with refactored pipeline and cleanup
- Deep-probe HLS manifests via known player globals, inline scripts, config objects
- Scan main frame only (no nested iframes); pick largest visible video per tab
- Store mediaType/hlsManifest metadata through the pipeline
- CSP-safe interceptor injection via script.src (not inline textContent)
- Remove probeFn/scrapeFn from Vite build entries (non-existent files)
- Refactor: extract m3u8DeepProbeFn, scrapeFn, scanVideos, storeVideos,
  makeVideoEntry, filterValidTabs, probeHlsManifests, dedupManifests, scrapeTab
  to module-level functions (no inline closures recreated on every click)
- Clean up viewer.js: extract createVideoElement(), createPanel(),
  consolidate HLS_CONFIG, remove console.log noise
- Add DEBUG flag to gate console output in popup
- Unify url/src fields — prefer 'src' everywhere
- Remove dead code in renderList and setTimeout(100) hack
2026-08-12 00:20:00 +00:00
kfj001 7416ae8ff9 Merge pull request 'feat: add HLS playback support with hls.js' (#1) from robot/goon_plugin:master into master
CI / test (push) Successful in 24s
Reviewed-on: http://192.168.1.74:30008/kfj001/goon_plugin/pulls/1
2026-08-10 20:50:43 -07: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
hermes e17b228ee0 fix: redesign HLS detection with 6-strategy per-tab query
CI / test (pull_request) Canceled after 0s
- Query HLS data structures directly from page JS state per tab
- Strategies: video element HLS instances, window-level player vars,
  intercepted data, inline scripts, global config objects, content script
- Fixed merge logic: index.js now correctly processes interceptedManifests
  and hlsQueryResults instead of non-existent playerData
- Skip blob: URLs in DOM scan (HLS-internal, can't be played directly)
- Only attach HLS manifest when actually detected for that tab
2026-08-10 20:39:49 +00:00
hermes c22631d1f1 fix: real-time HLS interception via content script (architectural overhaul)
CI / test (pull_request) Canceled after 0s
Previous approach (DOM snapshot via executeScript) failed on Pornhub because:
- Video player loads asynchronously via JavaScript
- HLS manifest arrives via XHR/fetch AFTER page render
- <video> element only shows blob: URL, not the actual manifest

New approach:
- Content script injects interceptor into MAIN world at document_start
- Interceptor patches XMLHttpRequest and fetch() to capture .m3u8 URLs
- Periodic DOM scans detect HLS player instances on <video> elements
- Global config object scanning for embedded stream URLs
- Popup queries content script via chrome.tabs.sendMessage for real-time data
- If no DOM videos found but content script has data, create entries from intercepted sources

Changes:
- content.js: Full rewrite with main-world injection + XHR/fetch interception
- index.js: Query content scripts via messages, merge with DOM snapshot
- manifest.json: all_frames + document_start for early injection
2026-08-10 18:53:27 +00:00
hermes db52db7799 fix: add HLS manifest extraction to scrapeFn (3 strategies)
CI / test (pull_request) Canceled after 0s
- Strategy 1: scan inline <script> blocks for .m3u8 URLs (skip subtitles/captions)
- Strategy 2: check video element HLS player instances (hlsInstance, _hls)
- Strategy 3: probe common global config objects (hlsConfig, playerConfig, etc.)
- Storage items now include hlsManifest and mediaType fields
- When HLS detected and src is blob:/empty, promote manifest URL to primary
- Backward compatible: direct MP4 entries unaffected
2026-08-10 17:07:55 +00:00
hermes 90c3425200 feat: add HLS playback support with hls.js
CI / test (pull_request) Canceled after 0s
- viewer.js: dynamic hls.js loading, HLS-aware panel creation, error handling
- schema.json: hlsManifest and mediaType fields (optional, backward compatible)
- types.ts: VideoEntry interface with MediaType type
- isHls() null guard fix
- tests: 39 tests (schema, viewer units, data flow, integration)
- CI: GitHub/Gitea Actions workflow (npm test on push/PR)
- deps: ajv, ajv-formats, jsdom for testing
2026-08-10 06:18:27 +00:00
Your Name baa72a4c33 Fixes css reference issue 2026-07-17 22:37:47 +00:00
kfj001 72d0a2dfe4 Updated gitignore 2026-06-08 20:13:51 +00:00
kfj001andClaude Opus 4.8 6122f67df3 Untrack icons/ — they are build artifacts, not source
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 20:13:19 +00:00
kfj001 93879bc8f7 Updates extensions in workspace. Alters plugin to scrape for NxN tabs for videos to display in the matrix. 2026-06-08 08:40:06 +00:00
kfj001 d5eb687606 Additional claude permissions. Updated devcontainer. 2026-06-08 06:29:25 +00:00
kfj001 c575162437 attempting to get extension to also work on pornhub 2026-05-31 22:55:20 -07:00
kfj001 cf3803806d allow scanning all tabs instead of limiting to 4
- Remove the hardcoded 4-tab limit in the find-videos flow
- Add per-tab try/catch so inaccessible tabs are skipped gracefully
- Filter out tabs that produced no frames from the dedup pipeline
- Update button label and status messages accordingly
2026-05-31 21:06:31 -07:00
kfj001 65fa2bddad scrapes from all open tabs. 2026-05-31 20:20:55 -07:00
kfj001 4a39065d90 core functionality complete 2026-05-31 11:29:51 -07:00
kfj001 f47301c0e4 working state - adds missing resources for chrome load 2026-05-30 13:12:49 -07:00
kfj001 95f5fdd3ea initial commit 2026-05-30 18:51:10 +00:00