A simple Chrome extension that automatically redirects specific domains to custom URLs.
You can register the current domain directly from the popup window β no need to edit the code manually.
- Redirect any domain to a specified URL
- Add redirect rules directly from the popup
- Delete rules from the popup
- Persistent rules (saved in Chrome local storage)
- Uses Declarative Net Request API (Manifest V3 compliant)
- Lightweight and fast (no background polling)
-
Clone this repository:
git clone https://github.com/yourname/domain-redirector.git cd domain-redirector -
Open Chrome and go to:
chrome://extensions/ -
Enable Developer mode (top-right corner).
-
Click Load unpacked and select this folder.
- Open any website (e.g.
https://example.com) - Click the extension icon
- Enter the redirect destination (e.g.
https://newsite.com) - Click Add
- Next time you visit
example.com, it will automatically redirect tonewsite.com - To remove a rule, click the ει€ button next to it in the list
redirect-extension/
βββ manifest.json # Extension manifest (v3)
βββ background.js # Service worker that updates redirect rules
βββ popup.html # Popup UI
βββ popup.js # Popup logic
βββ README.md # This file
- Manifest V3
- Declarative Net Request API
- Chrome Storage API
- Vanilla JavaScript (ES6)
If you add this rule in the popup:
match: https://example.com
redirectTo: https://newsite.com
Then any request to:
https://example.com/page1
https://example.com/foo/bar
will automatically redirect to:
https://newsite.com
- Rules are domain-based (e.g., all pages under the same origin are redirected)
- Subdomains are also matched automatically (e.g.,
www.example.com,blog.example.com) - Redirects are handled natively by Chrome for maximum performance
MIT License Β© 2025 gumuncle
- Support regex or path-based redirects
- Sync rules across devices using
chrome.storage.sync
β‘ Built for developers who need to auto-redirect domains quickly and efficiently.