Tag
#Chrome Extension3 notes
All notes tagged “Chrome Extension”.

Detecting CDN Failures in a Bilibili Extension and Falling Back to Backup Nodes
How the extension decides a CDN node is really broken: which errors to ignore, how to detect stalls from currentTime and the forward buffer, why it switches once quietly before asking you, and how it avoids bouncing between nodes. Also covers live streams.
繁體中文 / English

Rewriting Bilibili's Stream CDN on the Fly from a Chrome Extension's MAIN World
Bilibili's stream URLs arrive through SSR __playinfo__, the playurl API, segment requests and the live API. Using bilibili-cdn-switcher's code, this walks through hooking each path, what gets rewritten, and the traps: one-shot Response bodies, read-only XHR responseText, and speed tests that must bypass your own hooks.
繁體中文 / English

Chrome Extensions: The Basics of MAIN World and ISOLATED World
Patched window.fetch in a content script and the page ignored you? What the MAIN and ISOLATED worlds can each see, the three ways to pick a world, when to split into two scripts, how they talk through localStorage and postMessage, and which forged messages to reject.
繁體中文 / English