A Chrome extension that adds customizable search shortcuts to your right-click context menu. Quickly search selected text across multiple search engines and websites with support for environment variables and dynamic URL templates.
- Custom Search Engines: Add unlimited custom search URLs to your context menu
- Environment Variables: Define variables with different values for dev, test, and prod environments
- Dynamic URL Templates: Use
{{variable}}
syntax to create flexible search URLs - Right-Click Integration: Seamlessly integrated into Chrome's context menu
- Import/Export: Backup and share your search configurations
- Easy Management: User-friendly options page for managing searches and environments
- Manifest V3: Built with the latest Chrome extension standards
(Coming soon)
-
Download or clone this repository:
git clone https://github.com/yourusername/custom-search-shortcuts.git
-
Open Chrome and navigate to
chrome://extensions/
-
Enable Developer mode (toggle in top-right corner)
-
Click Load unpacked
-
Select the extension directory
-
The extension icon should appear in your toolbar!
- Open the extension popup
-
Create environments
-
Add a Search Engine:
- Click the extension icon or right-click and select "Manage Custom Searches"
- Enter a name (e.g., "Google")
- Enter a URL with
%s
as the search placeholder:https://www.google.com/search?q=%s
- Click "Add URL"
-
Use Your Search:
- Select any text on a webpage
- Right-click β Custom Search β Select your search engine
- A new tab opens with your search results
Perfect for developers who need to search across different environments (dev, staging, production).
-
Define a Variable:
- Go to Options β Variables section
- Variable name:
api_host
- Default value:
api.example.com
- Click "Add Variable"
-
Create Environments:
- Go to Options β Environments section
- Add environments:
- Dev:
api_host
=dev-api.example.com
- Test:
api_host
=test-api.example.com
- Prod:
api_host
=api.example.com
- Dev:
-
Create Search URL with Variable:
- Name: "API Docs"
- URL:
https://{{api_host}}/docs/search?q=%s
- Click "Add URL"
-
Use Environment-Specific Search:
- Select text on a webpage
- Right-click β Custom Search β API Docs β Choose environment (Dev/Test/Prod)
- Opens the correct environment's documentation
custom-search-shortcuts/
βββ manifest.json # Extension configuration
βββ background.js # Service worker (context menu logic)
βββ popup.html # Extension popup UI
βββ popup.js # Popup functionality
βββ options.html # Options page UI
βββ options.js # Options page logic
βββ icons/ # Extension icons
β βββ icon16.png
β βββ icon48.png
β βββ icon128.png
βββ LICENSE # MIT License
βββ README.md # This file
- manifest.json: Extension metadata and permissions
- background.js: Handles context menu creation and click events
- options.js: Manages URL, variable, and environment configuration
- popup.js: Simple popup with link to options page
contextMenus
: Create right-click menu itemsstorage
: Save user configurations (synced across devices)
-
Make your changes to the code
-
Update version in
manifest.json
:"version": "1.0.1"
-
Test locally:
- Go to
chrome://extensions/
- Click the refresh icon on your extension
- Test on various websites
- Go to
-
Create test URLs using the examples in the Testing Guide
Test your extension with various scenarios:
Basic Text Selection:
- Simple ASCII text
- Unicode characters (cafΓ©, εδΊ¬, π)
- Special characters (&, ?, #, %)
Different Page Types:
- Static HTML pages
- Single-page applications (SPAs)
- Content-editable areas
Environment Variables:
- URLs with single variable
- URLs with multiple variables
- Missing variable definitions
- Empty environment values
Test URLs:
Dev: http://localhost:3000/test.html
Test: https://staging.yourdomain.com/
Prod: https://yourdomain.com/
- Go to Options page
- Click Export Configuration
- Save the JSON file
- Go to Options page
- Click Import Configuration
- Select your JSON file
- Your searches, variables, and environments are restored
{
"urls": [
{
"id": "custom-search-1234567890",
"name": "Google",
"url": "https://www.google.com/search?q=%s"
}
],
"variables": [
{
"name": "api_host",
"defaultValue": "api.example.com"
}
],
"environments": [
{
"id": "env-1234567890",
"name": "Dev",
"values": [
{
"key": "api_host",
"value": "dev-api.example.com"
}
]
}
]
}
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
- Follow existing code style
- Test thoroughly before submitting
- Update documentation for new features
- Keep commits focused and descriptive
- Add comments for complex logic
Found a bug or have an idea? Please open an issue on GitHub:
- Check if the issue already exists
- Provide detailed description
- Include steps to reproduce (for bugs)
- Add screenshots if applicable
- Specify Chrome version and OS
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2025 Vinay Chowdary Duvvada
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
This extension is provided βas isβ without warranty of any kind, express or implied. Use at your own risk. The authors are not responsible for any data loss, security issues, policy violations, or damages arising from the use of this software.
Thirdβparty websites and services referenced by your custom search URLs are owned and operated by their respective providers. This project is not affiliated with, endorsed by, or sponsored by any third parties (including Google, Amazon, GitHub, etc.). Always review and comply with the terms of service and robots/usage policies of the websites you query. Be careful when creating URLs that include sensitive information (such as tokens, secrets, or personal data). Do not store or share sensitive data in plain text. If you distribute this extension, you are responsible for ensuring compliance with the Chrome Web Store policies and all applicable laws and regulations in your jurisdiction.
- Built with Chrome Extension Manifest V3
- Icons designed for clarity and simplicity
- Inspired by the need for quick, customizable web searches
- Issues: GitHub Issues
- Email: your.email@example.com
- Documentation: Chrome Extension Docs
- Initial public release
- Custom search URLs
- Environment variables support
- Import/Export functionality
- Context menu integration
Made with β€οΈ by Vinay Duvvada
β Star this repo if you find it useful!