Building a Lightweight Browser Extension Media Sniffer with Manifest V3

Building a Lightweight Browser Extension Media Sniffer with Manifest V3 featured header illustration

A great download manager needs a browser extension to capture video, audio, and large download files automatically.

We explore how to build a lightweight media sniffer using Google Chrome's Manifest V3 extension guidelines.

Web Request Header Listening

The extension uses declarative net request and web request APIs to listen to file extensions and mime types in the background:

// Chrome MV3 Web Request Listener
chrome.webRequest.onBeforeRequest.addListener(
  (details) => {
    if (isMediaURL(details.url)) {
      sendToNativeApp(details.url);
    }
  },
  { urls: [""] }
);

Instant Native Forwarding

Captured streaming URLs are immediately forwarded to our desktop client using secure native messaging, initiating high-speed downloads in a single click.