F1 BLOCKING — walk() cycle detection (src/viewer/index.js:161)
CI / test (pull_request) Successful in 5m41s

Added a per-tree WeakSet visited-guard so the probe terminates. The depth cap alone didn't stop the infinite recursion: window/_parent/_top/frames/_globalObject/_globalProxy are mutually-reachable circular Proxies, so Strategy H's window scan re-walked the same identities along exponentially many paths. The set is declared inside walk (not the outer function) so the separate player trees stay independent. This is what was hanging npm test (exit 124); it now completes in ~15s.
F2 SHOULD-FIX — doc/behavior mismatch (src/background/background.js:299-322)
Reworded the referer-capture comment block. It claimed the referer was read "via onBeforeSendHeaders, which sees the request headers," but the code uses onBeforeRequest + chrome.tabs.get (deriving the referer from the source tab's URL). Now states the actual mechanism and documents why onBeforeSendHeaders+extraHeaders was avoided (extraInfoSpec is rejected by some Chromium builds and fails the whole SW).
F3 SHOULD-FIX — leaked settings file
git rm --cached .claude/settings.local.json and added it to .gitignore. It carried machine-specific absolute paths (/Users/kyle/.claude/...).
F4 FYI — package-lock churn (package-lock.json)
Removed the spurious root "dependencies": { @rollup/rollup-darwin-arm64 } and restored the dev: true / optional: true flags on that platform package so it matches the rest of the @rollup/rollup-* siblings.
F5 FYI — real provider hostnames in test fixtures
Swapped phncdn.com→neutral example.net (registrable-domain sibling test) and thisvid.com→example.com in data_flow/hls_qa/simple_video/referer_proxy test files, rewording comments that named the real sites. src/ and __tests__/ now have zero phncdn/thisvid/pornhub references.
This commit is contained in:
kfj001 committed 2026-08-30 21:56:05 +00:00
1 parent ff463c107a
commit 3e02a6ae74
9 files changed
+70 -75

No files matched your search

+17 -17
View File
@@ -1,7 +1,7 @@
// Regression tests: simple <video> / direct-media detection.
//
// The feature branch broke detection of pages that expose a plain <video>
// (e.g. thisvid.com, which serves a direct MP4 with a TRAILING SLASH and a
// (e.g. a site that serves a direct MP4 with a TRAILING SLASH and a
// ?rnd= query: .../14644093/14644093.mp4/?rnd=...). Two site-agnostic fixes
// are guarded here:
// 1) The URL predicate (isValidManifestUrl) must let concrete media signals
@@ -9,7 +9,7 @@
// slash rejections, so a real direct-media URL is not mistaken for a
// route template.
// 2) scrapeTab must fall back to an ISOLATED-world scrape when the MAIN-world
// scrape yields nothing — the runtime cause of "detects nothing" on thisvid
// scrape yields nothing — the runtime cause of "detects nothing" on such pages
// is a MAIN-world + allFrames rejection on its ad-iframe-heavy page.
import { describe, it } from './runner.mjs';
import { JSDOM } from 'jsdom';
@@ -40,12 +40,12 @@ function extractFn(src, name) {
throw new Error('unbalanced: ' + name);
}
// The thisvid direct-media URL, exactly as served (note the trailing slash +
// The direct-media URL, shaped exactly like the rejected case (a trailing slash +
// ?rnd= query). This is the concrete case the predicate used to reject.
const THISVID_MP4 =
'https://thisvid.com/get_file/5/6cae22f8b3ba9d74f10cc2f8d060af738c8d30ddf5/14644000/14644093/14644093.mp4/?rnd=1787811205406';
const DIRECT_MP4 =
'https://example.com/get_file/5/6cae22f8b3ba9d74f10cc2f8d060af738c8d30ddf5/14644000/14644093/14644093.mp4/?rnd=1787811205406';
describe('HLS QA: simple <video> direct-media predicate (thisvid regression)', () => {
describe('HLS QA: simple <video> direct-media predicate', () => {
// Extract and evaluate the REAL isValidManifestUrl from index.js in a browser
// window so its `new URL(...)` / string behavior matches production.
const isValidSrc = extractFn(indexSource, 'isValidManifestUrl');
@@ -53,7 +53,7 @@ describe('HLS QA: simple <video> direct-media predicate (thisvid regression)', (
function assertValid(url, expectValid, label) {
const dom = new JSDOM(
'<!DOCTYPE html><html><body></body></html>',
{ url: 'https://thisvid.com/videos/x/', runScripts: 'dangerously' }
{ url: 'https://example.com/videos/x/', runScripts: 'dangerously' }
);
const got = dom.window.eval('(' + isValidSrc + ')(' + JSON.stringify(url) + ')');
if (got !== expectValid) {
@@ -63,9 +63,9 @@ describe('HLS QA: simple <video> direct-media predicate (thisvid regression)', (
}
}
it('accepts thisvid\'s real direct-MP4 URL WITH a trailing slash + ?rnd=', () => {
it('accepts a real direct-MP4 URL WITH a trailing slash + ?rnd=', () => {
// Before the fix, `path.endsWith('/')` rejected this real media source.
assertValid(THISVID_MP4, true, 'thisvid trailing-slash MP4');
assertValid(DIRECT_MP4, true, 'trailing-slash MP4');
});
it('accepts a direct .mp4 with no trailing slash', () => {
@@ -86,18 +86,18 @@ describe('HLS QA: simple <video> direct-media predicate (thisvid regression)', (
assertValid('https://cdn.example.com/live/master.m3u8?h=a%2Bb%2Fc&e=1234', true, '%2B token');
});
it('still rejects thisvid route-template / nav URLs (no over-acceptance)', () => {
it('still rejects route-template / nav URLs (no over-acceptance)', () => {
// The fix must not trade one regression for the other: the route templates
// thisvid\'s pageContext.langUrls leaks must still be rejected.
assertValid('https://thisvid.com/playlists/', false, '/playlists/');
assertValid('https://thisvid.com/playlists/liked/', false, '/playlists/liked/');
assertValid('https://thisvid.com/playlist/%1%/video/%2%/', false, '/playlist/%1%/');
assertValid('https://thisvid.com/members/%ID%/playlists/', false, '/members/%ID%/playlists/');
assertValid('https://thisvid.com/videos/%DIR%/', false, '/videos/%DIR%/');
// a provider's pageContext.langUrls leaks must still be rejected.
assertValid('https://example.com/playlists/', false, '/playlists/');
assertValid('https://example.com/playlists/liked/', false, '/playlists/liked/');
assertValid('https://example.com/playlist/%1%/video/%2%/', false, '/playlist/%1%/');
assertValid('https://example.com/members/%ID%/playlists/', false, '/members/%ID%/playlists/');
assertValid('https://example.com/videos/%DIR%/', false, '/videos/%DIR%/');
});
});
describe('HLS QA: scrapeTab isolated-world fallback (thisvid regression)', () => {
describe('HLS QA: scrapeTab isolated-world fallback', () => {
// Extract the whole scrapeTab function (balanced braces, indentation-agnostic).
const scrapeSrc = extractFn(indexSource, 'scrapeTab');