Methodology: This project utilizes Main World Injection to bypass YouTube’s ad-serving logic. Instead of relying on traditional filter-list matching (which is increasingly ineffective), it directly manipulates the HTMLVideoElement prototype.
Technical Implementation:
-
Native Override: Intercepts
HTMLVideoElement.prototype.playat the Main World level, preventing YouTube’s scripts from forcing pauses or ad injection. -
Execution Sync: Employs
requestAnimationFramefor loop execution. This achieves hardware-synced timing, minimizing CPU overhead (<1%) and maintaining stability on low-end hardware (i3-3rd Gen / HDD). -
Bridge Pattern: Implements an Isolated-to-Main world bridge to mitigate
Extension context invalidatederrors, ensuring persistent control throughout the session.
Purpose: This serves as a Proof of Concept (PoC) for an alternative ad-blocking architecture. It demonstrates that by shifting from passive network filtering to active state manipulation, performance-critical ad-interception can be achieved without relying on bloated, high-latency filter list updates.
Project: Ad-injector/blocker
P/S: Likely not completed and tested.