A powerful browser extension for bidirectional URL switching and redirection between related websites.
Features • Installation • Usage • Documentation • Contributing • License
- Bidirectional URL Conversion: Seamlessly switch between related websites (e.g., github.com ↔ github.dev)
- Powerful Rule Management: Create, edit, and organize URL conversion rules
- Group Organization: Rules can be organized into logical groups (GitHub, StackOverflow, etc.)
- Flexible Control: Global extension toggle and per-rule group enabling/disabling
- Auto-redirect Mode: Automatically redirect to the target site based on your rules
- Import/Export: Easily backup and share your rule configurations
- Multilingual Support: Full interface available in English and Chinese (中文)
- Go to the Releases page
- Download the latest
.zipfile - Unzip the file to a local folder
- Open Chrome and navigate to
chrome://extensions - Enable "Developer mode" in the top-right corner
- Click "Load unpacked" and select the unzipped folder
URL Switch will be available in the Chrome Web Store soon.
-
Clone this repository
git clone https://github.com/pyth0nb3st/URLSwitch.git cd URLSwitch -
Install dependencies
npm install
-
Build the extension
npm run build
-
Load in Chrome
- Open Chrome and navigate to
chrome://extensions - Enable "Developer mode" in the top-right corner
- Click "Load unpacked" and select the
distdirectory from this project
- Open Chrome and navigate to
- Navigate to any website
- Click the URL Switch icon in your browser toolbar
- Select from available redirects for the current page
- Toggle "Auto Redirect" for automatic switching
Access the options page by:
- Right-clicking the extension icon and selecting "Options"
- Clicking "Settings" in the extension popup
In the options page, you can:
- Create and manage rule groups
- Add, edit or delete URL conversion rules
- Configure global settings
- Import/export your rules
URL Switch uses regular expressions for matching and transforming URLs:
- From Pattern: The regex pattern to match source URLs
- To Pattern: The transformation pattern with capture group references
Example:
- From Pattern:
^https?://github\.com/([^/]+/[^/]+)(?:/.*)?$ - To Pattern:
https://github.dev/$1
This converts https://github.com/username/repo to https://github.dev/username/repo
/src- Source code/background- Background service worker/content- Content scripts/popup- Extension popup UI/options- Options page UI/hooks- React hooks/utils- Utility functions/_locales- Localization files
/icons- Extension icons/.github/workflows- CI/CD configuration
- Node.js 18+ and npm
Start the development server:
npm run devBuild the extension:
npm run buildPackage the extension as a zip file:
npm run packageThe project includes automated versioning and release scripts:
# For patch version (1.0.0 -> 1.0.1)
npm run release:patch
# For minor version (1.0.0 -> 1.1.0)
npm run release:minor
# For major version (1.0.0 -> 2.0.0)
npm run release:majorThese commands will:
- Update the version in manifest.json
- Commit the changes
- Create a git tag
- Push to GitHub
- Trigger the CI/CD pipeline to build and create a release
This project uses GitHub Actions for continuous integration and delivery:
- Automatically builds the extension on pushes to main branch
- Creates releases with packaged .zip files when a new tag is pushed
- Generates release notes automatically
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
