Commit Graph
29 Commits
Author SHA1 Message Date
kfj001 62d1244558 additional files 2026-08-28 08:51:27 +00:00
kfj001andClaude 0030d031f1 fix(scan): recover simple <video> detection site-agnostically
The no-mention-of-pornhub branch stopped finding plain <video> elements on
pages like thisvid.com. Two site-agnostic causes, both fixed without any
site-specific references:

1. Predicate over-rejection: isValidManifestUrl (and the nested isManifestUrl
   in m3u8DeepProbeFn) ran the placeholder/`%`/trailing-slash rejections
   BEFORE the concrete media signals. thisvid serves its direct MP4 WITH a
   trailing slash (.../14644093.mp4/?rnd=...), so `path.endsWith('/')`
   rejected a real, fetchable source. Concrete media signals (.mp4/.webm/.ogv/
   .mpd/.m4s/.m3u8/.hlsvod//hls/) now win outright, so a coincidental '%' or
   trailing slash never sinks a real source — while genuine route templates
   (/playlists/, /playlist/%1%/, /videos/{id}/) are still rejected.

2. Runtime cause on ad-iframe-heavy pages: scrapeTab ran only a MAIN-world
   scrape. A MAIN-world + allFrames injection can reject on pages with
   sandboxed/opaque-origin ad iframes, returning 0 videos even when a <video>
   is visible. scrapeTab now falls back to an isolated-world scrape (no `world`
   key — always permitted) when the MAIN-world run finds nothing. The per-frame
   reduction was extracted into a shared reduceScrapeFrames helper.

Adds __tests__/simple_video.test.mjs: a thisvid isValidManifestUrl battery
(trailing-slash MP4 accepted, templates still rejected, %2B/%2F tokens
preserved) plus a structural guard that scrapeTab keeps both a MAIN-world
primary and an isolated-world fallback.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-28 01:17:35 -07:00
kfj001 7139c5ea6f fix(scan): run deep probe/scraper in MAIN world; reject route-template "manifests"
CI / test (pull_request) Successful in 5m48s
The video-detection pipeline was finding nothing on pages that have a bare
<video> element. Two root causes:

1. world: 'MAIN' placement. The deep probe + scraper are injected with
   chrome.scripting.executeScript. Their code (and its own comments) requires
   the MAIN world to see page globals — window.Hls, per-<video> Hls instances,
   video._goon_hls_manifest, and window.__goon_plugin_data (written by the
   main-world interceptors). The calls were missing it, so every main-world
   strategy (A/A2/E/H) found 0. It was also briefly placed inside `target`,
   which chrome.scripting rejects ("Unexpected property: 'world'"); `world` is
   a sibling of `target` on ScriptInjection. Restore it as a sibling of target.

2. fake "manifest" classification. Strategy H was reporting 10 nav links /
   server-side route TEMPLATES as manifests — e.g. /playlists/,
   /playlists/liked/, /playlist/%1%/video/%2%/, /members/%ID%/playlists/ —
   because the old /playlist|/manifest substring check matches nav menus and
   leaves %1%/%ID%/%DIR% template placeholders intact. Those then became the
   stored "video" entries, drowning out the real element.

   isManifestUrl and isValidManifestUrl now reject:
     - dynamic route templates (%NAME% or {name} tokens), using a negative
       lookahead so genuine %-encoded tokens like %2B/%2F are preserved
       (the invariant the codebase explicitly protects),
     - plural collection paths (/playlists, /manifests),
     - trailing-slash directory listings.

   The 'World: ISOLATED' probe log was also misleading (typeof chrome is not a
   world discriminator — the probe provably runs in MAIN); replaced it.

Adds a regression test (hls_qa) reproducing thisvid's pageContext.langUrls
scenario: all 10 templates are rejected while a real .m3u8 carrying a %2B token
is still detected. 90/90 tests pass; 0 lint errors; build OK.
2026-08-25 20:27:14 -07:00
kfj001 e3b904783f fix(proxy): stop per-tab referer wipe and concurrent DNR rule race
CI / test (pull_request) Successful in 28s
Address robot's review on PR #5:

- [Blocking] 'goon_referers' is a host-keyed GLOBAL store and must outlive
  its capture tab; it was wrongly added to the per-tab onRemoved cleanup, so
  closing any tab wiped referers captured by still-open source tabs (-> 412).
  It is no longer removed on tab close. Stale referers are now pruned
  opportunistically in persistReferer via a per-host timestamp + TTL.

- [Should-fix] the DNR referer rule used a single shared REFERER_RULE_ID with
  a non-atomic check+update, so concurrent proxy fetches for two hosts could
  interleave and leave the wrong host's referer live. Each host now gets its
  own stable rule id (refererRuleIdFor) and the install+record is serialized
  per host via an async lock (refererRuleLocks).

- [Coverage] add __tests__/referer_proxy.test.mjs exercising the new
  referer-capture / proxy-host / onRemoved paths: closing a tab preserves
  goon_referers, two hosts proxied concurrently keep distinct per-host rules,
  and same-host proxy is idempotent.
2026-08-25 15:35:24 -07:00
kfj001 66c621825f refactor: decouple from site-specific CDN references
CI / test (pull_request) Successful in 37s
The extension had hard-coupled itself to one provider's CDN throughout
background.js and its consumers: a host allowlist, a static
declarativeNetRequest rule that forced a fixed site origin as the Referer,
site-named message types/functions, and illustrative comments naming the
site. This commit removes every reference so the code is generic and
provider-agnostic (and no longer names a specific site for reviewers).

What changed:

  - background.js
      * Dropped the PHNCDN_HOSTS allowlist; video-request capture is now
        host-agnostic (any CDN, driven by isVideoRequest / isHlsManifest).
      * Removed the static DNR rule that forced a fixed site origin as the
        Referer. Replaced with per-tab dynamic capture: an
        onBeforeSendHeaders listener captures the provider's own Referer for
        each video request the live page makes and stores it per CDN host
        (goon_referers). The proxy handler installs a DNR rule scoped to the
        requested host using that captured referer, so the provider's exact
        origin is extracted at runtime instead of hard-coded.
      * Generalized the reconstruction helpers: extractVideoId ->
        extractGroupKey (path-directory key, no /hls/videos/ assumption),
        buildManifestForVariant / reconstructManifestsFromSegments swap a
        segment filename for master.m3u8 dir-agnostically, freshLiveForVideo
        -> freshLiveForGroup, and the GOON_GET_PHNCDN_REQUESTS handler ->
        GOON_GET_VIDEO_REQUESTS. Resolver response key videoId -> groupKey
      * Reworded prose comments to describe behavior generically.

  - manifest.json
      * Added the extraHeaders permission so onBeforeSendHeaders can read the
        Referer header (needed for the dynamic capture above).

  - viewer.js / index.js (consumers)
      * Proxying decision now keys off a learned goon_proxy_hosts set
        (populated from a startup CORS probe) instead of hard-coded host
        substrings; removed the hard-coded CORS ping.
      * filterManifests / isValidManifestUrl generalized (kept the
        .m3u8 / .hlsvod / .ts behavior the tests assert); rank key
        phncdn_reconstructed -> hls_reconstructed; queryPhncdnRequests ->
        queryVideoRequests.

  - content.js, interceptors.js, and two test-prose strings: the illustrative
    "sites like <site>" comments generalized.

Verification: 83/83 tests pass, 0 lint errors. A repo-wide grep for the
previously-referenced host / site now returns no matches. The pre-existing
tsc errors in vite.config.ts are unrelated (present on the prior commit).

Note on the dynamic referer: it works while the source tab is open (it reads
that tab's real Referer); if the tab closed before capturing, the proxy falls
back to a host-derived origin, which a strict origin check may still reject --
the tradeoff of not hard-coding the site.
2026-08-25 02:26:16 -07:00
kfj001 dc2c8092f0 Merge pull request 'Feature/rebrand' (#4) from feature/rebrand into master
CI / test (push) Successful in 27s
Reviewed-on: http://192.168.1.74:30008/kfj001/goon_plugin/pulls/4
Reviewed-by: robot <robot@westerntechnologies.duckdns.org>
2026-08-24 18:42:42 -07:00
kfj001 cb607306bc Reverts plugin changes unrelated to rebranding efforts.
CI / test (pull_request) Successful in 26s
2026-08-24 23:58:57 +00:00
kfj001 7d56e836c9 minor changes to reccomended plugins
CI / test (pull_request) Successful in 25s
2026-08-24 22:53:13 +00:00
kfj001 9420bce9c1 Merge pull request 'fix(tests): stop hls_qa deep-probe suite hanging under jsdom (test-only)' (#3) from fix/jsdom-cycle-hang-hls-qa into master
CI / test (push) Successful in 36s
Reviewed-on: http://192.168.1.74:30008/kfj001/goon_plugin/pulls/3
Reviewed-by: kfj001 <kfj001@gmail.com>
2026-08-24 10:28:08 -07:00
kfj001 7336643ea4 Merge pull request 'feat: full HLS.js support — detection via interceptors + deep probe, playback via hls.js in viewer' (#2) from hls-fix into master
CI / test (push) Failing after 16m10s
Reviewed-on: http://192.168.1.74:30008/kfj001/goon_plugin/pulls/2
Reviewed-by: kfj001 <kfj001@gmail.com>
2026-08-23 18:22:41 -07:00
kfj001 63e5c600dc Adds step to generate artifacts in ci/cd env.
CI / test (pull_request) Successful in 11m30s
2026-08-24 01:10:08 +00:00
kfj001 b6a11d9e46 fixes broken unit test
CI / test (pull_request) Failing after 11m2s
2026-08-23 17:38:14 -07:00
kfj001 c9f49b58d8 Working on pornhub
CI / test (pull_request) Failing after 10m34s
2026-08-20 10:59:05 -07:00
kfj001 001cf146ee Attempted fix at pornhub video
CI / test (pull_request) Failing after 10m39s
2026-08-16 23:00:47 -07:00
kfj001 b234c8dcae fix: HLS playback — CORS proxy for phncdn.com + diagnostic logging
Problem: Even after fixing the hls.js file naming (was 'hls.min.js', now
'hls.js'), videos don't play in the viewer. Likely root cause is CORS
blocking chrome-extension:// requests to phncdn.com CDN URLs that lack
CORS headers for extension origins.

Solution — two-layer fix:

1. Service worker proxy (background.js):
   - New GOON_PROXY_FETCH handler fetches any URL via native fetch()
     (no CORS restrictions in the service worker)
   - Returns base64-encoded response data to the viewer

2. Custom HLS loader (viewer/viewer.js):
   - HlsLoader implements hls.js Loader interface
   - For phncdn.com/pornhubcdn URLs: proxies via GOON_PROXY_FETCH
   - For all other URLs: uses native XHR (bypasses proxy overhead)
   - Config passed to hls.js only when manifest URL needs proxying

3. Diagnostics (viewer/viewer.js):
   - CORS check at page load for phncdn.com and per-video URL
   - Full storage dump of video entries in console
   - Manifest URL logging on each HLS load attempt
   - Proxy activation logging for debugging
2026-08-16 16:42:12 -07:00
kfj001 fa0a0d76cd fix: rename hls.min.js -> hls.js to match vite build output
The vite config outputs 'hls.js' but manifest.json and viewer.js
both referenced 'hls.min.js', causing chrome.runtime.getURL() to
return a 404 — triggering 'HLS player unavailable'.

- Update web_accessible_resources entry in manifest.json
- Update loadHlsJs() chrome.runtime.getURL reference
- Add debug log of manifest URL being loaded for diagnostics
2026-08-16 16:28:55 -07:00
kfj001 509948def1 feat: deep probe strategies G (non-enumerable/Symbol) and H (full window scan)
Strategy G — Independent non-enumerable + Symbol property detection on video elements.
Uses Object.getOwnPropertyNames/Symbols to catch properties hidden by enumerable:false or Symbol keys.
Walks nested objects for URL/levels/config signatures matching HLS instance heuristics.

Strategy H — Full window global enumeration with player-like key filtering.
Catches previously-unknown globals the player wrapper exposes internally.

Content script bridge — merge content-level intercepted manifests into
window.__goon_plugin_data so both interceptors and executeScript share findings.

Add phncdn_reconstructed to dedup priority ranking.
2026-08-16 16:22:07 -07:00
kfj001 877feec731 feat: Strategy 8 — enhance phncdn.com network fallback detection
- Log ALL phncdn.com requests (not just .m3u8) to chrome.storage.local
- Reconstruct manifest URLs from segment URL patterns (/videos/{id}/playlist.m3u8)
- Add GOON_GET_PHNCDN_REQUESTS message handler for popup consumption
- Add queryPhncdnRequests() consumer in viewer/index.js
- Integrate reconstructed manifests into scan pipeline (step 1.6)
2026-08-16 16:17:29 -07: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
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