Skip to content

About

Browser extension to inject a Fastly-Debug header into all requests

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Fastly Debug Headers

A browser extension that adds the Fastly-Debug request header to all HTTP requests while enabled. This unlocks detailed cache debugging information in responses from Fastly CDN services.

Works in Chrome, Microsoft Edge, and Firefox (Manifest V3).

What it does

When turned on, the extension injects a Fastly-Debug header on every outbound request (navigation, XHR, images, scripts, WebSockets, etc.). Fastly responds with extra diagnostic headers that are normally stripped.

When turned off, no header is added and browsing is unaffected.

The extension is off by default on first install.

Quick start (local install)

Chrome / Edge

  1. Clone this repo.
  2. Open chrome://extensions (or edge://extensions).
  3. Enable Developer mode.
  4. Click Load unpacked and select this directory.
  5. Click the extension icon and toggle On.

Firefox

  1. Clone this repo.
  2. Build the Firefox package: node scripts/pack.js firefox
  3. Open about:debugging → This Firefox → Load Temporary Add-on.
  4. Select manifest.json in the dist/firefox directory.

For a permanent install, see PUBLISHING.md.

Usage

  1. Click the toolbar icon to open the popup.
  2. Toggle On to start injecting Fastly-Debug.
  3. Optionally change the header value (default 1). Some Fastly services require a secret value configured in VCL instead of 1.
  4. Open DevTools → Network, reload a page served by Fastly, and inspect headers.

Fastly header reference

Request header (what this extension sends)

Header Value Notes
Fastly-Debug 1 (default) or custom Any value triggers debug output; 1 is conventional

Security

Debug responses expose internal cache topology, server identities, and surrogate keys. Many production services strip Fastly-Debug from public requests or require a secret value in VCL:

if (req.http.Fastly-Debug != "your-secret-value") {
  unset req.http.Fastly-Debug;
}

Use this extension only on sites you own or are authorized to debug.

Permissions

Permission Why
declarativeNetRequest Add Fastly-Debug to requests via dynamic rules
storage Remember on/off state and custom debug value
<all_urls> Apply the header globally while enabled

The extension does not read page content, collect browsing history, or transmit data to any server. See PRIVACY.md.

Development

This extension has zero runtime dependencies. The only JavaScript that runs in the browser is background.js and popup/popup.js.

To build store ZIPs (optional — only needed for publishing):

node scripts/pack.js all      # dist/*.zip for Chrome, Edge, Firefox
node scripts/pack.js firefox  # dist/firefox only (for local Firefox testing)

Firefox needs a slightly different manifest (background.scripts instead of service_worker). The pack script handles that — no npm install required.

Optional Firefox lint before publishing (downloads tooling on demand, nothing committed):

node scripts/pack.js firefox
npx --yes web-ext lint -s dist/firefox

Browser-specific packages

Chrome and Edge use a Manifest V3 service worker. Firefox requires background.scripts instead, so node scripts/pack.js all produces separate ZIPs:

Output Use for
dist/fastly-debug-headers-chrome.zip Chrome Web Store
dist/fastly-debug-headers-edge.zip Microsoft Edge Add-ons
dist/fastly-debug-headers-firefox.zip Firefox AMO

For local development, load the repo root unpacked in Chrome/Edge, or dist/firefox in Firefox.

Project layout

manifest.json       Extension manifest (MV3)
background.js       Service worker — dynamic DNR rules, badge
popup/              Toggle UI and custom value input
icons/              Extension icons (committed, no build step)
scripts/pack.js     Optional pack script for store ZIPs (Node stdlib only)

Publishing

See PUBLISHING.md for step-by-step guides to the Chrome Web Store, Microsoft Edge Add-ons, and Firefox Add-ons (AMO).

About

Browser extension to inject a Fastly-Debug header into all requests

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages