|
| 1 | +# Browser Router |
| 2 | + |
| 3 | +**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. |
| 4 | + |
| 5 | +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. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## 🖥️ Features |
| 10 | + |
| 11 | +- Pattern-based rule system (e.g. `*.github.com → Firefox`) |
| 12 | +- Set a default fallback browser |
| 13 | +- Built-in GUI for rule management |
| 14 | +- Automatically handles incoming HTTP/HTTPS links |
| 15 | +- Optional prompt to update browser path or download if not found |
| 16 | + |
| 17 | +--- |
| 18 | + |
| 19 | +## 📦 Installation |
| 20 | + |
| 21 | +You can install Browser Router by using the provided [`BrowserRouterInstaller.exe`](https://github.com/x011/browser-router/releases/latest/download/BrowserRouterInstaller.exe) installer (from GitHub Releases), or build your own. |
| 22 | + |
| 23 | +The installer will: |
| 24 | + |
| 25 | +- Copy all necessary files |
| 26 | +- Create a Start Menu and Desktop shortcut |
| 27 | +- Register Browser Router as a Windows browser handler |
| 28 | + |
| 29 | +--- |
| 30 | + |
| 31 | +## 🧪 How to Set Browser Router to Handle HTTP and HTTPS Link Types (Windows 11) |
| 32 | + |
| 33 | +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: |
| 34 | + |
| 35 | +### ✅ Option 1: Set by Link Type |
| 36 | + |
| 37 | +1. Open **Settings > Apps > Default Apps** |
| 38 | +2. Click the **search box** under “**Set a default for a file type or link type**” (top of page) |
| 39 | +3. Type `http` and press Enter |
| 40 | +4. Click the result and choose **`Browser Router.exe`** from the list |
| 41 | +5. Repeat the same steps for `https` |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +### ✅ Option 2: Set by Application |
| 46 | + |
| 47 | +1. Open **Settings > Apps > Default Apps** |
| 48 | +2. In the search bar at the top, type: `Browser Router` |
| 49 | +3. Click on **Browser Router** from the results |
| 50 | +4. Set it as the default for **HTTP** and **HTTPS** |
| 51 | + |
| 52 | +--- |
| 53 | + |
| 54 | +📌 Once you've done either method, Browser Router will handle any link you click from other apps (email, chat, etc.). |
| 55 | + |
| 56 | +--- |
| 57 | + |
| 58 | +## 📁 Configuration |
| 59 | + |
| 60 | +When run, Browser Router stores config in: |
| 61 | + |
| 62 | +``` |
| 63 | +%LOCALAPPDATA%\Browser Router\browser_rules.json |
| 64 | +``` |
| 65 | + |
| 66 | +Inside the GUI, you can: |
| 67 | + |
| 68 | +- Add/edit/delete rules |
| 69 | +- Set a default browser |
| 70 | +- Export/import rule sets |
| 71 | +- Manage custom browser paths |
| 72 | + |
| 73 | +--- |
| 74 | + |
| 75 | +## 🧩 Example Use Case |
| 76 | + |
| 77 | +| Pattern | Browser | |
| 78 | +|----------------------|------------------| |
| 79 | +| `*.github.com` | Firefox Developer | |
| 80 | +| `*.youtube.com` | Brave | |
| 81 | +| `*.onion` | Tor Browser | |
| 82 | + |
| 83 | +Browser Router will open the link in the correct browser — no matter where you clicked it. |
| 84 | + |
| 85 | +--- |
| 86 | + |
| 87 | +## ⚙️ Compile (Optional) |
| 88 | + |
| 89 | +Browser Router is provided as a binary installer (if using prebuilt releases). |
| 90 | +But you can also compile it yourself and build a custom installer. |
| 91 | + |
| 92 | +### Step 1: Compile the executable |
| 93 | + |
| 94 | +Install **PyInstaller** if you haven’t already: |
| 95 | + |
| 96 | +```bash |
| 97 | +pip install pyinstaller |
| 98 | +``` |
| 99 | + |
| 100 | +Then run: |
| 101 | + |
| 102 | +```bash |
| 103 | +pyinstaller --onedir --noconsole --icon "path/to/browser_router.ico" browser_router.py |
| 104 | +``` |
| 105 | + |
| 106 | +This creates an output folder: |
| 107 | + |
| 108 | +``` |
| 109 | +dist/browser_router/ |
| 110 | +``` |
| 111 | + |
| 112 | +### Step 2: Adjust the NSIS script |
| 113 | + |
| 114 | +In your `.nsi` installer script, replace the file copy path: |
| 115 | + |
| 116 | +```nsis |
| 117 | +File /r "dist\browser_router\*.*" |
| 118 | +``` |
| 119 | + |
| 120 | +Then compile the NSIS script using NSIS to generate your installer (`BrowserRouterInstaller.exe`). |
| 121 | + |
| 122 | +--- |
| 123 | + |
| 124 | +## 🧑💻 Development |
| 125 | + |
| 126 | +This project is written in **Python 3** using `tkinter`. |
| 127 | + |
| 128 | +Dependencies: |
| 129 | +- Standard Library only |
| 130 | +- `pyinstaller` (for building the `.exe`) |
| 131 | + |
| 132 | +--- |
| 133 | + |
| 134 | +## 📝 Notes |
| 135 | + |
| 136 | +- Run the app once manually to initialize the config file |
| 137 | +- The installer is fully self-contained and portable |
| 138 | +- Works great for developers, security researchers, and browser nerds 👨💻🧪 |
| 139 | + |
| 140 | +--- |
| 141 | + |
| 142 | +## 📂 Project Structure (Suggested) |
| 143 | + |
| 144 | +``` |
| 145 | +browser_router/ |
| 146 | +├── browser_router.py |
| 147 | +├── browser_router.ico |
| 148 | +├── browser_router.nsi |
| 149 | +├── README.md |
| 150 | +├── LICENSE |
| 151 | +├── dist/ # Output from PyInstaller |
| 152 | +│ └── browser_router/ |
| 153 | +├── set_browser_router_http_https.reg # (optional, not required for Win11) |
| 154 | +├── unset_browser_router.reg # (optional, not required for Win11) |
| 155 | +``` |
| 156 | + |
| 157 | +--- |
| 158 | + |
| 159 | +## 📜 License |
| 160 | + |
| 161 | +This project is licensed under the **GNU General Public License v3.0** |
| 162 | +🔗 [Read the full license text](https://www.gnu.org/licenses/gpl-3.0.html) |
| 163 | + |
| 164 | +--- |
| 165 | + |
| 166 | +Made with 💚 by X011. |
0 commit comments