BingBeGone

Architecture πŸ—οΈ

This document explains how BingBeGone works internally.

Or at least how it works when Chrome is behaving itself.


Overview

BingBeGone is a lightweight Manifest V3 browser extension that intercepts Bing search navigations and redirects them to a user-selected search engine.

The extension operates entirely client-side.

No backend. No cloud infrastructure. No Kubernetes cluster held together by fear. No AI microservice named β€œOrchestrator.”

Just browser code.


High-Level Flow

Windows / App / User
        ↓
 Opens Bing Search URL
        ↓
 Browser navigates to:
 bing.com/search?q=...
        ↓
 BingBeGone detects navigation
        ↓
 Extract search query
        ↓
 Build replacement URL
        ↓
 Redirect OR show redirect page
        ↓
 Open preferred search engine

Repository Structure

extension/
β”œβ”€ assets/
β”œβ”€ background.js
β”œβ”€ defaults.js
β”œβ”€ manifest.json
β”‚
β”œβ”€ lib/
β”‚  β”œβ”€ redirectBuilder.js
β”‚  β”œβ”€ storage.js
β”‚  └─ urlParser.js
β”‚
β”œβ”€ pages/
β”‚  β”œβ”€ options.html
β”‚  β”œβ”€ options.js
β”‚  β”œβ”€ redirect.html
β”‚  β”œβ”€ redirect.js
β”‚  └─ redirect.css
β”‚
└─ popup/
   β”œβ”€ popup.html
   β”œβ”€ popup.js
   └─ popup.css

Core Components

background.js

Main extension service worker.

Responsibilities:

This is effectively the extension’s brain.

Which is unfortunate because it is JavaScript.


urlParser.js

Responsible for:

Example:

Input:

https://www.bing.com/search?q=snakes

Output:

{
  query: "snakes"
}

redirectBuilder.js

Constructs the final redirect destination.

Example:

google:
https://www.google.com/search?q=snakes

Supports:


storage.js

Handles settings persistence.

Uses:

Settings include:


The popup provides:

It exists because users enjoy buttons.


Options Page

The options page handles:

This is where power users become dangerous.


Redirect Page

Optional interstitial page shown before redirecting.

Purpose:

Useful for:


Why Manifest V3?

Because Google said so.

Also:

Also because Manifest V2 is being slowly marched into the forest.


Navigation Detection

BingBeGone uses:

chrome.webNavigation.onBeforeNavigate

This allows the extension to:

Only Bing domains are monitored.

The extension does not inspect unrelated browsing activity.


Why Not declarativeNetRequest?

declarativeNetRequest works best for static redirects.

BingBeGone requires:

Using navigation listeners provides more flexibility with simpler logic.

Also the debugging experience is approximately 700% less painful.


Security Model

BingBeGone intentionally minimizes:

The extension:

All processing occurs locally.

Like a civilized utility.


Performance

The extension is effectively idle most of the time.

Processing only occurs when:

Typical workload:

  1. parse URL
  2. build redirect
  3. redirect tab

Measured resource usage: β€œbasically nothing”

Scientific.


Browser Compatibility

Officially supported:

Compatible with most Chromium browsers supporting:

Including:

Potentially:


Future Ideas

Potential future features:

Potentially NOT future features:

Made with questionable precision by Barely βŠ… Compliant Studios.