feat: full HLS.js support — detection via interceptors + deep probe, playback via hls.js in viewer #2
@@ -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')
|
// 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
|
// instead of a CDN — sites like Pornhub restrict script-src to 'self', blocking
|
||||||
// cross-origin <script src> injection from CDN URLs.
|
// cross-origin <script src> injection from CDN URLs.
|
||||||
if (!viewerSource.includes("chrome.runtime.getURL('hls.min.js')")) {
|
if (!viewerSource.includes("chrome.runtime.getURL('hlds.js')")) {
|
||||||
throw new Error('viewer.js should load hls.min.js from extension origin, not CDN');
|
throw new Error('viewer.js should load hlds.js from extension origin, not CDN');
|
||||||
}
|
}
|
||||||
// Verify no CDN references remain (cdn.jsdelivr, unpkg, etc.)
|
// Verify no CDN references remain (cdn.jsdelivr, unpkg, etc.)
|
||||||
const cdnRefs = viewerSource.match(/https?:\/\/(cdn\.jsdelivr|unpkg|cdnjs)/g);
|
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(', ')})`);
|
throw new Error(`viewer.js should not reference CDN URLs (found: ${cdnRefs.join(', ')})`);
|
||||||
}
|
}
|
||||||
// Verify the vendored bundle exists in dist
|
// 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)) {
|
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;
|
const hlsSize = fs.statSync(hlsPath).size;
|
||||||
if (hlsSize < 200_000) {
|
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`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user