c22631d1f18a11ad9f062e3cac548b6d0f6deaa0
CI / test (pull_request) Canceled after 0s
Previous approach (DOM snapshot via executeScript) failed on Pornhub because: - Video player loads asynchronously via JavaScript - HLS manifest arrives via XHR/fetch AFTER page render - <video> element only shows blob: URL, not the actual manifest New approach: - Content script injects interceptor into MAIN world at document_start - Interceptor patches XMLHttpRequest and fetch() to capture .m3u8 URLs - Periodic DOM scans detect HLS player instances on <video> elements - Global config object scanning for embedded stream URLs - Popup queries content script via chrome.tabs.sendMessage for real-time data - If no DOM videos found but content script has data, create entries from intercepted sources Changes: - content.js: Full rewrite with main-world injection + XHR/fetch interception - index.js: Query content scripts via messages, merge with DOM snapshot - manifest.json: all_frames + document_start for early injection
Goon Plugin
A Chrome extension (Manifest V3) that finds videos on the current page and displays them in a 2x2 grid.
Features
- Click the extension icon → "Find Videos" to scan the current tab for all
<video>elements - Videos are listed in the popup for reference (clickable links, "Copy All URLs" button)
- Click "Open Viewer" to open a new window with videos in a 2x2 grid (autoplay muted)
- Click "Clear" to reset the stored video list
Getting started
# 1. Install deps
npm i
# 2. Run in watch mode
npm run dev
# 3. Build for distribution
npm run build
Loading in Chrome
- Open
chrome://extensions/ - Enable Developer mode (top-right)
- Click Load unpacked → select the project root folder (where
manifest.jsonis located)
Project structure
manifest.json — Extension manifest (MV3)
package.json — Dev tooling (Vite + Vitest + TS)
vite.config.ts — Build config
src/
background/ — Service worker (MV3 background)
content/ — Content script
viewer/ — Popup UI + video viewer
index.html — Popup (Find Videos, Open Viewer buttons)
index.js — Popup logic (scans current tab for videos)
index.css — Popup styles
viewer.html — Viewer page (2x2 video grid in new window)
viewer.js — Viewer logic (renders video panels)
viewer.css — Viewer grid styles
icons/ — Extension icons (place .png files here)
Recommended extensions (VS Code)
- Chrome Extension Developer (extension-list-viewer)
- ESLint
- Prettier
VS Code workspace
Open goon_plugin.code-workspace to get the project with recommended extensions pre-installed.