A professional Chrome extension that allows you to quickly and easily change your browser's User-Agent string. Perfect for web developers, testers, and users who need to emulate different browsers and devices.
README en espaΓ±ol | Changelog | License
- Intuitive popup interface: Fast User-Agent switching with a single click
- Global and per-tab modes:
- DEFAULT: Use browser's original User-Agent
- AUTO: Automatically detect and use the best User-Agent for each site
- Custom User-Agents: Set specific User-Agents per tab
- Visual badge system: Shows the active User-Agent alias on the extension icon
- No badge when DEFAULT is active
- Custom badge for each User-Agent
Full-featured options page with multiple sections:
- Add unlimited custom User-Agents
- Two operation modes:
- Replace: Completely replaces the browser's User-Agent
- Append: Adds text to the current User-Agent
- Customizable badge with:
- Alias (max 4 characters)
- Edit and delete custom User-Agents
- Pre-configured User-Agents included (iPhone 14, Android)
- Set specific User-Agents for particular domains
- Supports wildcards:
*.example.com,localhost/core/* - Automatic application without manual intervention
- Manage your permanent spoofs list easily
- Export: Save all your settings to a JSON file
- Custom User-Agents
- Permanent Spoof List
- Extension settings
- Timestamped file names
- Import: Restore settings from a JSON file
- Drag & drop support
- Preview before importing
- Merge or replace existing settings
- Theme selector (Auto, Light, Dark)
- Language selector (English, Spanish)
- Extension information and version
- Reset functionality
- Support and contribution links
- Extension automatically disables on Chrome special pages
- Prevents modification of protected pages like:
chrome://(Chrome internal pages)chrome-extension://(Extension pages)edge://(Edge internal pages)about:(About pages)
- Clear visual feedback with:
- Red badge with β symbol
- Disabled message in popup
- Security explanation
- English (en)
- Spanish (es)
- Easy to add more languages via JSON locale files
- Auto: Follows system preference
- Light: Light theme
- Dark: Dark theme
- Consistent styling across all interfaces
- Download or clone this repository
- Open Google Chrome and navigate to
chrome://extensions/ - Enable Developer mode (toggle in the top right corner)
- Click Load unpacked
- Select the
UserAgentChangerproject folder - Done! The extension icon will appear in your toolbar
- Click the extension icon in the toolbar
- Select one of the options:
- DEFAULT: Use browser's original User-Agent (global setting)
- AUTO: Automatic User-Agent detection (global setting)
- Custom User-Agent: Apply specific User-Agent to current tab
- The badge will show the active User-Agent alias
- Changes apply immediately
- Click the extension icon
- Click "βοΈ Manage User-Agents" button
- A new tab opens with the full management interface
- Go to "Custom User-Agents" section
- Fill in the form:
- Name: Descriptive name (e.g., "iPhone 14 Pro")
- Alias: Short identifier for badge (max 4 characters)
- Mode: Choose "Replace" or "Append"
- User-Agent String: Full User-Agent string
- Click "Add User-Agent"
- Go to "Permanent Spoof List" section
- Enter the domain pattern (e.g.,
*.google.com,localhost/*) - Select the User-Agent to apply
- Click "Add Permanent Spoof"
- The spoof will apply automatically to matching domains
- Go to "Import/Export Settings" section
- To Export:
- Click "Click Here To Download"
- Save the JSON file with your settings
- To Import:
- Select a JSON file or drag & drop it
- Preview the settings before importing
- Choose to merge or replace existing settings
- Confirm the import
UserAgentChanger/
βββ manifest.json # Extension configuration
βββ popup.html # Popup HTML
βββ options.html # Options page HTML
βββ generate_icons.html # Icon generator utility
βββ README.md # This file (English)
βββ README_ES.md # Spanish README
βββ CHANGELOG.md # Version history
βββ LICENSE # MIT License
βββ LICENSE_ES.md # Spanish license
βββ PRIVACY_POLICY.md # Privacy Policy (English)
βββ PRIVACY_POLICY_ES.md # Privacy Policy (Spanish)
βββ _locales/ # Internationalization
β βββ en/
β β βββ messages.json # English translations
β βββ es/
β βββ messages.json # Spanish translations
βββ css/ # Stylesheets
β βββ commons.css # Common styles
β βββ popup.css # Popup styles
β βββ theme.css # Theme variables
β βββ options/ # Options page styles
β βββ about.css
β βββ cards.css
β βββ forms.css
β βββ header.css
β βββ import-export.css
β βββ layout.css
βββ icons/ # Extension icons
β βββ icon16.png
β βββ icon32.png
β βββ icon48.png
β βββ icon128.png
β βββ icon256.png
β βββ logo.png
βββ js/ # JavaScript files
βββ background.js # Main background service worker
βββ background-badge.js # Badge management
βββ background-listeners.js # Event listeners
βββ background-permanentSpoofs.js # Permanent spoofs logic
βββ background-userAgent.js # User-Agent application
βββ popup.js # Popup logic
βββ options.js # Options page logic
βββ common-constants.js # Shared constants
βββ common-i18n.js # Internationalization
βββ common-messaging.js # Inter-component communication
βββ common-notify.js # Notification system
βββ common-storage.js # Storage utilities
βββ common-ua.js # User-Agent utilities
βββ common-utils.js # General utilities
βββ common-validations.js # Input validations
βββ common-version.js # Version management
- Manifest V3: Latest Chrome extension system
- declarativeNetRequest API: For modifying HTTP request headers
- Chrome Storage API: For persisting configurations
- Chrome Badge API: For showing indicators on the icon
- Chrome Tabs API: For per-tab User-Agent management
- HTML5/CSS3/JavaScript: Modern and responsive interface
- CSS Custom Properties: Dynamic theming
- Internationalization API: Multi-language support
This extension requires the following permissions to function properly:
-
declarativeNetRequest- Purpose: Allows the extension to modify HTTP request headers
- Why needed: Essential for changing the User-Agent header in web requests. This API enables the extension to intercept and modify the User-Agent string before requests are sent to servers.
-
activeTab- Purpose: Grants temporary access to the currently active tab when you interact with the extension
- Why needed: Allows the extension to apply User-Agent changes to the tab you're currently viewing when you use the popup. This is a privacy-friendly permission that only works when you explicitly click the extension icon.
- Security benefit: Unlike broad permissions,
activeTabonly grants access when you actively use the extension, ensuring maximum privacy and security.
-
storage- Purpose: Provides access to Chrome's storage API
- Why needed: Stores all extension configurations locally, including:
- Custom User-Agent definitions
- Permanent spoof list
- User preferences (theme, language)
- Badge colors and settings
- Active User-Agent state per tab
-
tabs- Purpose: Allows interaction with browser tabs
- Why needed: Required for:
- Detecting when tabs are created, updated, or removed
- Managing per-tab User-Agent settings
- Updating the badge on the extension icon for each tab
- Opening the options page in a new tab
- Detecting Chrome special pages to disable the extension
-
scripting- Purpose: Provides access to Chrome's scripting API
- Why needed: Enables advanced functionality for:
- Dynamic content interaction if needed
- Future feature enhancements
- Improved compatibility with web pages
- Minimal permissions: Uses
activeTabinstead of broad host permissions for enhanced privacy - Chrome Web Store compliant: Follows best practices for extension permissions
- Always up-to-date User-Agent: Automatically uses the browser's current User-Agent (obtained from Service Worker) as the base, ensuring compatibility without hardcoded values
- Local storage only: All data is stored locally using Chrome's storage API
- No external communication: No data is transmitted to external servers
- Header-only modification: The extension only modifies User-Agent headers, not page content
- Automatic protection: Prevents modifications on Chrome special pages (
chrome://,edge://, etc.)
- Web Development: Test how your site looks on different devices
- Testing: Verify User-Agent-specific behavior
- Web Scraping: Simulate different browsers or devices
- Privacy: Modify your browser fingerprint
- Content Access: Some sites show different content based on device
- Automation: Set permanent spoofs for specific development environments
- API Testing: Test API responses for different User-Agents
- All data is stored locally in your browser
- No information is sent to external servers
- No browsing data is collected
- Open source and auditable
- Automatic protection on Chrome special pages
- Respects browser security restrictions
- User-Agent applies to all HTTP/HTTPS requests
- Changes are immediate without needing to reload tabs
- "Append" mode uses the current Chrome User-Agent as base
- DEFAULT mode shows no badge on icon
- Permanent spoofs take precedence over global settings
- Extension is disabled on Chrome special pages for security
- Google Chrome (Chromium-based browsers)
- Microsoft Edge
- Brave
- Opera
- Any Chromium-based browser supporting Manifest V3
Trystan4861
- GitHub: @Trystan4861
- Repository: UserAgentChanger
Contributions are welcome! If you find a bug or have a suggestion:
- Open an issue on the GitHub repository
- If you want to contribute code, fork the repository and create a pull request
- Follow the existing code style and conventions
- Add appropriate tests for new features
- Update documentation as needed
- Clone the repository
- Make your changes
- Test in Chrome by loading the unpacked extension
- Submit a pull request with a clear description
This project is licensed under the MIT License. See the LICENSE file for details.
If you have problems or questions:
- Check that the extension is enabled in
chrome://extensions/ - Verify you have sufficient permissions
- Check the extension's error console
- Review closed issues for similar problems
- Open a new issue if needed
Future features under consideration:
- More pre-configured User-Agents
- User-Agent templates
- Statistics and usage tracking
- Cloud sync (optional)
- Browser detection improvements
- Additional language support
- Custom User-Agent rotation
- Advanced filtering options
Developed with β€οΈ to facilitate web development and testing.
Star β this repository if you find it useful!