diff --git a/.claude/settings.local.json b/.claude/settings.local.json deleted file mode 100644 index 33213ad..0000000 --- a/.claude/settings.local.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "permissions": { - "allow": [ - "Bash(npm run *)", - "Bash(node --check /home/kyle/Documents/goon_plugin/src/viewer/index.js)", - "Bash(open -a \"Microsoft Edge\" --args --remote-debugging-port=9222 --profile-directory=Default)", - "Bash(git checkout *)", - "Bash(node --check src/viewer/index.js)", - "Bash(node /Users/kyle/.claude/jobs/1462df8d/tmp/transform2.mjs)", - "Bash(node __tests__/run.mjs)", - "Bash(node -e \"console.log\\(\\(require\\('./package.json'\\).scripts||{}\\).build || '\\(no build script\\)'\\)\")", - "Bash(git check-ignore *)", - "Bash(node --check __tests__/simple_video.test.mjs)", - "Bash(node --check __tests__/run.mjs)", - "WebSearch", - "Bash(node *)", - "Bash(python3 *)", - "Bash(git stash *)", - "Bash(npm -v)", - "Bash(npm install *)" - ] - } -} diff --git a/.gitignore b/.gitignore index ad211e6..d671384 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ node_modules/ dist/ .vscode-insiders/ /icons -/icons/* \ No newline at end of file +/icons/* +.claude/settings.local.json \ No newline at end of file diff --git a/__tests__/data_flow.test.mjs b/__tests__/data_flow.test.mjs index b39b428..1625bd0 100644 --- a/__tests__/data_flow.test.mjs +++ b/__tests__/data_flow.test.mjs @@ -193,8 +193,8 @@ describe('Data flow: popup -> storage -> viewer', () => { // explicit property or storage-layer validation would reject the entry. const scrapedEntry = { url: 'https://pageA.example.com/watch', - src: 'https://hv-h.phncdn.com/hls/live/master.m3u8', - hlsManifest: 'https://hv-h.phncdn.com/hls/live/master.m3u8', + src: 'https://cdn.example.com/hls/live/master.m3u8', + hlsManifest: 'https://cdn.example.com/hls/live/master.m3u8', mediaType: 'hls', poster: 'https://pageA.example.com/thumb.jpg', tab: 'Referer-protected stream', diff --git a/__tests__/hls_qa.test.mjs b/__tests__/hls_qa.test.mjs index a293121..3962af3 100644 --- a/__tests__/hls_qa.test.mjs +++ b/__tests__/hls_qa.test.mjs @@ -1262,24 +1262,24 @@ describe('HLS QA: route-template / nav URL rejection', () => { return result; } - // Reproduces thisvid.com: pageContext.langUrls holds server-side route + // Reproduces a provider whose pageContext.langUrls holds server-side route // TEMPLATES / nav links (e.g. /playlists/, /playlist/%1%/video/%2%/) that the // old /playlist|/manifest substring check misclassified as "manifests". const TEMPLATE_URLS = [ - 'https://thisvid.com/playlists/', - 'https://thisvid.com/playlists/liked/', - 'https://thisvid.com/playlists/popular/', - 'https://thisvid.com/playlists/commented/', - 'https://thisvid.com/playlists/updated/', - 'https://thisvid.com/playlists/largest/', - 'https://thisvid.com/playlist/%1%/video/%2%/', - 'https://thisvid.com/playlists/?category=%DIR%', - 'https://thisvid.com/members/%ID%/playlists/', - 'https://thisvid.com/my/playlists/%ID%/', + 'https://example.com/playlists/', + 'https://example.com/playlists/liked/', + 'https://example.com/playlists/popular/', + 'https://example.com/playlists/commented/', + 'https://example.com/playlists/updated/', + 'https://example.com/playlists/largest/', + 'https://example.com/playlist/%1%/video/%2%/', + 'https://example.com/playlists/?category=%DIR%', + 'https://example.com/members/%ID%/playlists/', + 'https://example.com/my/playlists/%ID%/', ]; it('route templates / nav links are NOT reported as manifests', () => { - const result = runProbeWin('https://thisvid.com/videos/redneck/', { + const result = runProbeWin('https://example.com/videos/redneck/', { pageContext: { langUrls: TEMPLATE_URLS }, kvsplayer: { config: { langUrls: TEMPLATE_URLS } }, __goon_plugin_data: { manifests: [], sources: [] }, @@ -1294,7 +1294,7 @@ describe('HLS QA: route-template / nav URL rejection', () => { it('a real .m3u8 with a %2B token is still found (no over-rejection)', () => { // %2B is a valid percent-encoded token, not a placeholder — it must survive. const real = 'https://cdn.example.com/live/master.m3u8?h=a%2Bb%2Fc&e=1234'; - const result = runProbeWin('https://thisvid.com/videos/redneck/', { + const result = runProbeWin('https://example.com/videos/redneck/', { hls: { url: real }, pageContext: { langUrls: TEMPLATE_URLS }, }); diff --git a/__tests__/referer_proxy.test.mjs b/__tests__/referer_proxy.test.mjs index afa4994..2a8e4de 100644 --- a/__tests__/referer_proxy.test.mjs +++ b/__tests__/referer_proxy.test.mjs @@ -252,26 +252,26 @@ describe('PR#5: per-host referer capture + proxy race', () => { }); await loadBackground(env); - // Capture the provider referer for hv-h.phncdn.com (one edge subdomain). - await capture(env, 'https://hv-h.phncdn.com/hls/live/seg-1.ts', 'https://provider.example.com/watch'); + // Capture the provider referer for hv-h.example.net (one edge subdomain). + await capture(env, 'https://hv-h.example.net/hls/live/seg-1.ts', 'https://provider.example.com/watch'); - // Proxy a SIBLING subdomain ev-h.phncdn.com with NO referer in the message: + // Proxy a SIBLING subdomain ev-h.example.net with NO referer in the message: // the SW must resolve it from the domain-keyed store. const handler = env.handlers.onMessage[env.handlers.onMessage.length - 1]; let resp; - handler({ type: 'GOON_PROXY_FETCH', url: 'https://ev-h.phncdn.com/hls/live/seg-1.ts' }, {}, (r) => { resp = r; }); + handler({ type: 'GOON_PROXY_FETCH', url: 'https://ev-h.example.net/hls/live/seg-1.ts' }, {}, (r) => { resp = r; }); await new Promise(r => setTimeout(r, 20)); if (!resp || !resp.ok) throw new Error('sibling proxy failed: ' + JSON.stringify(resp)); const rules = env.getSessionRules(); - const rule = Object.values(rules).find(r => r.condition?.requestDomains?.includes('phncdn.com')); - if (!rule) throw new Error('no domain-scoped DNR rule for phncdn.com; rules=' + JSON.stringify(rules)); + const rule = Object.values(rules).find(r => r.condition?.requestDomains?.includes('example.net')); + if (!rule) throw new Error('no domain-scoped DNR rule for example.net; rules=' + JSON.stringify(rules)); const ref = rule.action.requestHeaders?.find(h => h.header.toLowerCase() === 'referer')?.value; if (ref !== 'https://provider.example.com/watch') { throw new Error('sibling edge served wrong referer: ' + ref); } // The rule is scoped to the registrable domain, NOT the exact subdomain. - if (rule.condition.requestDomains?.includes('ev-h.phncdn.com')) { + if (rule.condition.requestDomains?.includes('ev-h.example.net')) { throw new Error('rule scoped to exact subdomain instead of registrable domain'); } }); @@ -313,23 +313,23 @@ describe('PR#5: per-host referer capture + proxy race', () => { global.chrome = env.chrome; await loadBackground(env); - // Capture for hv-h.phncdn.com only. - await capture(env, 'https://hv-h.phncdn.com/hls/live/seg-1.ts', 'https://provider.example.com/watch'); + // Capture for hv-h.example.net only. + await capture(env, 'https://hv-h.example.net/hls/live/seg-1.ts', 'https://provider.example.com/watch'); const handler = env.handlers.onMessage[env.handlers.onMessage.length - 1]; let resp; handler( - { type: 'GOON_GET_REFERERS', hosts: ['ev-h.phncdn.com', 'hv-h.phncdn.com', 'cdnA.example.com'] }, + { type: 'GOON_GET_REFERERS', hosts: ['ev-h.example.net', 'hv-h.example.net', 'cdnA.example.com'] }, {}, (r) => { resp = r; }); await new Promise(r => setTimeout(r, 15)); if (!resp || !resp.ok) throw new Error('GOON_GET_REFERERS failed: ' + JSON.stringify(resp)); const referers = resp.referers || {}; - if (referers['ev-h.phncdn.com'] !== 'https://provider.example.com/watch') { + if (referers['ev-h.example.net'] !== 'https://provider.example.com/watch') { throw new Error('sibling subdomain did not resolve the captured referer: ' + JSON.stringify(referers)); } - if (referers['hv-h.phncdn.com'] !== 'https://provider.example.com/watch') { + if (referers['hv-h.example.net'] !== 'https://provider.example.com/watch') { throw new Error('captured subdomain did not resolve its own referer: ' + JSON.stringify(referers)); } if ('cdnA.example.com' in referers) { diff --git a/__tests__/simple_video.test.mjs b/__tests__/simple_video.test.mjs index 268e199..80121df 100644 --- a/__tests__/simple_video.test.mjs +++ b/__tests__/simple_video.test.mjs @@ -1,7 +1,7 @@ // Regression tests: simple