Skip to content

Custom Windows link handler that routes HTTP/HTTPS URLs to different browsers based on user-defined rules.

Notifications You must be signed in to change notification settings

x011/browser-router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Browser Router

Browser Router is a custom link handler for Windows that intercepts HTTP and HTTPS links and opens them in different browsers based on user-defined rules.

This tool lets you define domain patterns (like *.example.com) and associate them with different browsers (Chrome, Firefox, Tor, etc.). When you click a link, Browser Router will open it in the appropriate browser according to your rules — or a default browser if no match is found.


🖥️ Features

  • Pattern-based rule system (e.g. *.github.com → Firefox)
  • Set a default fallback browser
  • Built-in GUI for rule management
  • Automatically handles incoming HTTP/HTTPS links
  • Optional prompt to update browser path or download if not found

📦 Installation

You can install Browser Router by using the provided BrowserRouterInstaller.exe installer (from GitHub Releases), or build your own.

The installer will:

  • Copy all necessary files
  • Create a Start Menu and Desktop shortcut
  • Register Browser Router as a Windows browser handler

🧪 How to Set Browser Router to Handle HTTP and HTTPS Link Types (Windows 11)

To make Browser Router open web links by default, you need to set it as the handler for the http and https link types. You can do this in one of two ways:

✅ Option 1: Set by Link Type

  1. Open Settings > Apps > Default Apps
  2. Click the search box under “Set a default for a file type or link type” (top of page)
  3. Type http and press Enter
  4. Click the result and choose Browser Router.exe from the list
  5. Repeat the same steps for https

✅ Option 2: Set by Application

  1. Open Settings > Apps > Default Apps
  2. In the search bar at the top, type: Browser Router
  3. Click on Browser Router from the results
  4. Set it as the default for HTTP and HTTPS

📌 Once you've done either method, Browser Router will handle any link you click from other apps (email, chat, etc.).


📁 Configuration

When run, Browser Router stores config in:

%LOCALAPPDATA%\Browser Router\browser_rules.json

Inside the GUI, you can:

  • Add/edit/delete rules
  • Set a default browser
  • Export/import rule sets
  • Manage custom browser paths

🧩 Example Use Case

Pattern Browser
*.github.com Firefox Developer
*.youtube.com Brave
*.onion Tor Browser

Browser Router will open the link in the correct browser — no matter where you clicked it.


⚙️ Compile (Optional)

Browser Router is provided as a binary installer (if using prebuilt releases).
But you can also compile it yourself and build a custom installer.

Step 1: Compile the executable

Install PyInstaller if you haven’t already:

pip install pyinstaller

Then run:

pyinstaller --onedir --noconsole --icon "path/to/browser_router.ico" browser_router.py

This creates an output folder:

dist/browser_router/

Step 2: Adjust the NSIS script

In your .nsi installer script, replace the file copy path:

File /r "dist\browser_router\*.*"

Then compile the NSIS script using NSIS to generate your installer (BrowserRouterInstaller.exe).


🧑‍💻 Development

This project is written in Python 3 using tkinter.

Dependencies:

  • Standard Library only
  • pyinstaller (for building the .exe)

📝 Notes

  • Run the app once manually to initialize the config file
  • The installer is fully self-contained and portable
  • Works great for developers, security researchers, and browser nerds 👨‍💻🧪

📂 Project Structure (Suggested)

browser_router/
├── browser_router.py
├── browser_router.ico
├── browser_router.nsi
├── README.md
├── LICENSE
├── dist/               # Output from PyInstaller
│   └── browser_router/
├── set_browser_router_http_https.reg   # (optional, not required for Win11)
├── unset_browser_router.reg            # (optional, not required for Win11)

📜 License

This project is licensed under the GNU General Public License v3.0
🔗 Read the full license text


Made with 💚 by X011.