Back to browse
GitHub Repository

Unduck done right: zero-deps, sub-1ms DuckDuckGo-style bang/snap redirector with 14,000+ DDG/Kagi/custom bangs, address bar autocomplete, no tracking.

33 starsTypeScript

Flashbang – Sub-1ms DuckDuckGo bang redirects via Service Workers

by t3ntxcles·Mar 3, 2026·1 point·1 comment

AI Analysis

●●●BangerWizardryShip It

Service Worker intercepts bangs before page load—measurably faster than every existing solution.

Strengths
  • Sub-1ms latency is genuinely impressive engineering: hashmap lookup + string template on raw bytes, zero page rendering.
  • 14,000+ bangs (custom + DDG + Kagi ranked by relevance); address bar autocomplete with frecency ranking.
  • Privacy-first with optional suggestions; fully self-hostable (Cloudflare Pages, Railway, Docker) so zero trust required.
Weaknesses
  • Solves a narrow problem (power users who already use bangs); adoption depends on setting a custom search engine, not frictionless.
  • Service Worker adoption requires modern browser support; offline bang resolution only works if offline mode is pre-cached.
Target Audience

Power users, privacy-conscious searchers, folks who live in the address bar.

Similar To

DuckDuckGo Bangs · Unduck · Kagi Bangs

Post Description

I liked DuckDuckGo's bangs (shortcuts like !g to search Google directly) but didn't want to use DuckDuckGo as my search engine and the bang redirects were slow. Projects like unduck solved this by redirecting bangs locally — but they all load a webpage, execute JavaScript, then call window.location.replace(). Searches had a visible flash before the redirect. Every alternative I've tested — whether it's a page-load redirect, a Cloudflare Worker, or a browser extension — adds measurable latency. I knew a Service Worker could solve this entirely — intercept the request before the browser renders anything. So I built my own tool.

Flashbang intercepts the request at the Service Worker level before the browser renders anything. The SW does a hashmap lookup and a string template fill on raw URL-encoded bytes. Median redirect latency is sub-1ms. The browser never loads a page.

How it works:

- Service Worker intercepts every search request before it becomes a navigation and before page starts loading

- Bang parsing operates on raw encoded strings — no decodeURIComponent, no regex, no new URL() in the hot path

- Supports all 7 DuckDuckGo bang syntax patterns (prefix, suffix, no-space, mid-query, etc.)

- 14,000+ bangs from DDG + Kagi, plus custom bangs

- Address bar autocomplete via OpenSearch with a radix trie, ranked by frecency (exponential decay, 14-day half-life)

- Once the SW is installed, redirects work fully offline

What it's not:

- Not a browser extension — it's a web app you set as your default search engine

- No tracking, no analytics, no telemetry

- Zero runtime dependencies

- AGPL-3.0

~2,600 lines of TypeScript, 1,200 lines of tests. I'd love feedback on the architecture.

https://github.com/ph1losof/flashbang

Similar Projects

Infrastructure●●●Banger

Wi.kifa.st

Sub-50ms Wikipedia reads using Cloudflare edge workers instead of heavy backend infrastructure.

WizardryBig BrainSolve My Problem
jasoncartwright
201mo ago
AI/ML●●●Banger

MicroGPT-C – C99 GPT for Edge Training and Tiny Model Pipelines

Karpathy's microgpt in C99, proves tiny coordinated models beat single large models on logic.

WizardryBig Brain
Ajay__soni
103mo ago
GamingMid

Play Bang Bang against a neural network

You play a minimalist web game while a neural net trains in real time, so the opponent starts weak and adapts to your playstyle. The landing page is extremely spare — the demo is quick to load and oddly charming, but there’s little signposting about the model, implementation details, or source code. Fun as a curiosity or teaching toy, but not novel enough to wow ML folks who’ve seen in-browser learning demos before.

Niche GemCozy
atum47
104mo ago