From d86c1d1778732a57ae9465efda4d90a0265c2891 Mon Sep 17 00:00:00 2001 From: robot Date: Wed, 12 Aug 2026 00:20:00 +0000 Subject: [PATCH] feat: add HLS deep-probe scanning with refactored pipeline and cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Deep-probe HLS manifests via known player globals, inline scripts, config objects - Scan main frame only (no nested iframes); pick largest visible video per tab - Store mediaType/hlsManifest metadata through the pipeline - CSP-safe interceptor injection via script.src (not inline textContent) - Remove probeFn/scrapeFn from Vite build entries (non-existent files) - Refactor: extract m3u8DeepProbeFn, scrapeFn, scanVideos, storeVideos, makeVideoEntry, filterValidTabs, probeHlsManifests, dedupManifests, scrapeTab to module-level functions (no inline closures recreated on every click) - Clean up viewer.js: extract createVideoElement(), createPanel(), consolidate HLS_CONFIG, remove console.log noise - Add DEBUG flag to gate console output in popup - Unify url/src fields — prefer 'src' everywhere - Remove dead code in renderList and setTimeout(100) hack --- .eslintignore | 1 + src/content/content.js | 123 +----- src/inject/interceptors.js | 134 +++++++ src/viewer/index.js | 800 ++++++++++++++++--------------------- src/viewer/viewer.js | 296 +++++++------- vite.config.ts | 1 + 6 files changed, 646 insertions(+), 709 deletions(-) create mode 100644 .eslintignore create mode 100644 src/inject/interceptors.js diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..849ddff --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +dist/ diff --git a/src/content/content.js b/src/content/content.js index 95aa748..9df35e9 100644 --- a/src/content/content.js +++ b/src/content/content.js @@ -24,123 +24,18 @@ /** * Inject interceptors into the MAIN world at document_start. - * Runs BEFORE any page JS, so we catch all HLS activity. + * + * Uses script.src = chrome.runtime.getURL('interceptors.js') instead of + * script.textContent to bypass strict page CSP. Sites like Pornhub enforce + * 'script-src' that blocks inline execution (textContent). Chrome treats + * extension-originated