/** * content.js - Content script injected into matching pages at document_start. * Runs in the ISOLATED world. * * Strategy: Inject XHR/fetch interceptors into the MAIN world at document_start * to capture HLS manifest URLs as they load. Also listen for postMessage events * from intercepted URLs. * * When the popup sends GOON_GET_VIDEO_DATA, we respond with: * - posterUrl: extracted poster/thumbnail * - interceptedManifests: manifests caught by XHR/fetch interceptors * - videoElements: DOM video elements with basic info * * The popup separately executes main-world scripts via chrome.scripting.executeScript * to deeply query HLS player state — this content script handles interception only. */ (function () { 'use strict'; // Collected intercepted HLS manifest URLs from XHR/fetch interception const interceptedManifests = []; const interceptedSources = new Set(); /** * Inject interceptors into the MAIN world at document_start. * * 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