feat: full HLS.js support — detection via interceptors + deep probe, playback via hls.js in viewer #2

Merged
kfj001 merged 15 commits from hls-fix into master 2026-08-23 18:22:42 -07:00
Showing only changes of commit b6a11d9e46 - Show all commits
+5 -5
View File
@@ -907,8 +907,8 @@ describe('HLS QA: Configuration and resource management', () => {
// Viewer loads hls.js from extension origin via chrome.runtime.getURL('hls.min.js')
// instead of a CDN — sites like Pornhub restrict script-src to 'self', blocking
// cross-origin <script src> injection from CDN URLs.
if (!viewerSource.includes("chrome.runtime.getURL('hls.min.js')")) {
throw new Error('viewer.js should load hls.min.js from extension origin, not CDN');
if (!viewerSource.includes("chrome.runtime.getURL('hlds.js')")) {
throw new Error('viewer.js should load hlds.js from extension origin, not CDN');
}
// Verify no CDN references remain (cdn.jsdelivr, unpkg, etc.)
const cdnRefs = viewerSource.match(/https?:\/\/(cdn\.jsdelivr|unpkg|cdnjs)/g);
@@ -916,13 +916,13 @@ describe('HLS QA: Configuration and resource management', () => {
throw new Error(`viewer.js should not reference CDN URLs (found: ${cdnRefs.join(', ')})`);
}
// Verify the vendored bundle exists in dist
const hlsPath = path.join(__dirname, '../dist/hls.js');
const hlsPath = path.join(__dirname, '../dist/hlds.js');
if (!fs.existsSync(hlsPath)) {
throw new Error('dist/hls.js not found — run npm run build');
throw new Error('dist/hlds.js not found — run npm run build');
}
const hlsSize = fs.statSync(hlsPath).size;
if (hlsSize < 200_000) {
throw new Error(`dist/hls.js too small (${hlsSize} bytes) — bundle may be empty`);
throw new Error(`dist/hlds.js too small (${hlsSize} bytes) — bundle may be empty`);
}
});