A comprehensive tool to add custom device presets to Chrome DevTools
Project description
Chrome Custom Devices Manager
Add 22+ desktop device presets to Chrome DevTools with one command. Perfect for testing responsive designs on MacBooks, iMacs, and other desktop resolutions.
Features
- ✅ Safe modification of Chrome Preferences (no core file changes)
- ✅ Multiple installation methods (direct, Vibranium CLI, manual)
- ✅ Cross-platform support (Windows, macOS, Linux)
- ✅ Automatic backup and rollback functionality
- ✅ Proper user agent generation for different device types
- ✅ Support for both portrait and landscape orientations
- ✅ Chrome process detection and safety warnings
Quick Start
Method 1: One-Command Remote Installation (Easiest)
# Install to ALL Chrome profiles with one command
curl -sSL https://raw.githubusercontent.com/hatimmakki/chrome-custom-devices/main/quick-install.sh | bash
Method 2: Python Package (PyPI)
# Install via pip
pip install chrome-custom-devices
# Run installation
chrome-devices --install-all
Method 3: Node.js Package (npm)
# Install globally via npm
npm install -g chrome-custom-devices
# Run installation
chrome-devices
Method 4: Homebrew (macOS)
# Add tap and install
brew tap hatimmakki/tap
brew install chrome-custom-devices
# Run installation
chrome-devices --install-all
Method 5: Local Development
# Clone and install locally
git clone https://github.com/hatimmakki/chrome-custom-devices.git
cd chrome-custom-devices
pip install -e .
chrome-devices --install-all
Method 6: Using Vibranium CLI
# Install Vibranium globally
npm install -g @pittankopta/vibranium
# Generate and install devices
chrome-devices --output vibranium
npx @pittankopta/vibranium add devices.json
Device List
The script includes the following devices:
| Device Name | Width | Height | DPR | Type |
|---|---|---|---|---|
| Apple MacBook 12-inch | 2304 | 1310 | 2 | Desktop |
| Apple MacBook Pro 13-inch | 2560 | 1470 | 2 | Desktop |
| Apple MacBook Pro 15-inch | 2880 | 1670 | 2 | Desktop |
| iMac 24 - 2021 | 2048 | 1152 | 2 | Desktop |
| MacBook PRO 16 - 2021 | 1728 | 1117 | 2 | Desktop |
| MacBook Air 13 - 2020 | 1280 | 800 | 2 | Desktop |
| MacBook Pro 16 - 2019 | 1536 | 960 | 2 | Desktop |
| MacBook Pro 13 - 2018 | 1280 | 800 | 2 | Desktop |
| MacBook Air 13 - 2018 | 1280 | 800 | 2 | Desktop |
| MacBook Pro 15 - 2018 | 1440 | 900 | 2 | Desktop |
| MacBook Pro 13 Pro - 2017 | 1440 | 900 | 2 | Desktop |
| MacBook Pro 15 Pro - 2017 | 1280 | 800 | 2 | Desktop |
| MacBook Pro 13 Pro - 2016 | 1280 | 800 | 2 | Desktop |
| MacBook Pro 15 Pro - 2016 | 1440 | 900 | 2 | Desktop |
| MacBook Pro 13 Pro - 2015 | 1280 | 800 | 2 | Desktop |
| MacBook Pro 15 Pro - 2015 | 1440 | 900 | 2 | Desktop |
| MacBook Pro 15 Pro - 2014 | 1440 | 900 | 2 | Desktop |
| Notebook with touch | 1280 | 950 | 1 | Desktop |
| Notebook with HiDPI screen | 1440 | 900 | 2 | Desktop |
| Dell Latitude 3420 14 | 1440 | 809 | 1 | Desktop |
| Microsoft Surface Duo | 1114 | 705 | 2.5 | Mobile |
| Generic notebook | 1280 | 800 | 1 | Desktop |
Installation
- Clone this repository:
git clone https://github.com/your-username/chrome-custom-devices.git
cd chrome-custom-devices
- Install Python dependencies:
pip install -r requirements.txt
- Run the script:
python chrome_devices_manager.py --help
Usage
One-Command Remote Installation
# The easiest way - installs to ALL Chrome profiles automatically
curl -sSL https://raw.githubusercontent.com/user/repo/main/quick-install.sh | bash
Python Script Commands
# Show help
python chrome_devices_manager.py --help
# Install to ALL Chrome profiles automatically (NEW!)
python chrome_devices_manager.py --install-all
# Install to a single Chrome profile (with selection)
python chrome_devices_manager.py --install
# List all found Chrome profiles
python chrome_devices_manager.py --list-profiles
# Generate Vibranium-compatible JSON
python chrome_devices_manager.py --output vibranium
# Generate manual installation files
python chrome_devices_manager.py --output manual
# Backup current Chrome settings
python chrome_devices_manager.py --backup
# Restore from backup
python chrome_devices_manager.py --restore backup_20231215_143022.json
Advanced Examples
# Install to a specific profile
python chrome_devices_manager.py --install --profile "/path/to/Chrome/Profile/Preferences"
# Backup a specific profile
python chrome_devices_manager.py --backup --profile "/path/to/Chrome/Profile/Preferences"
# Generate devices JSON in different formats
python chrome_devices_manager.py --output preferences # For direct modification
python chrome_devices_manager.py --output manual # For manual installation
python chrome_devices_manager.py --output vibranium # For Vibranium CLI
Safety Features
- Automatic Backup: Creates timestamped backups before any modifications
- Chrome Detection: Warns if Chrome is running during installation
- Profile Detection: Automatically finds Chrome profiles on your system
- Rollback Support: Easy restoration from backups
- Validation: Verifies JSON structure before installation
Supported Platforms
- Windows: Chrome, Chrome Beta, Chrome Dev, Chrome Canary
- macOS: Chrome, Chrome Beta, Chrome Dev, Chrome Canary
- Linux: Chrome, Chromium, Chrome Beta, Chrome Dev
Contributing
- Fork the repository
- Create a feature branch
- Add your devices to the
devices.pyfile - Test your changes
- Submit a pull request
License
MIT License - see LICENSE file for details.
Changelog
v1.1.0 (2025-06-22)
- Added one-command remote installation script (
quick-install.sh) - Added
--install-allflag to install to ALL Chrome profiles automatically - Enhanced cross-platform support for Chrome variants (Beta, Dev, Canary, Arc, Chromium)
- Improved user experience with colored output and progress indicators
- Added comprehensive profile detection and display
- Self-contained bash script with embedded device data
v1.0.0 (2025-06-22)
- Initial release
- Support for 22 custom devices
- Multiple installation methods
- Cross-platform compatibility
- Automatic backup and restore functionality
Troubleshooting
Chrome settings are overridden
- Make sure Chrome is completely closed before running the script
- Check that you're modifying the correct profile
Devices don't appear in DevTools
- Restart Chrome after installation
- Check DevTools > Settings > Devices
- Verify the JSON structure in your Preferences file
Permission errors
- Run with administrator/sudo privileges if needed
- Check file permissions on Chrome profile directory
Credits
- Inspired by mfehrenbach's Chrome device dimensions gist
- Uses Vibranium CLI tool for automated installation
- Based on Chrome DevTools device emulation API
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chrome_custom_devices-1.0.10.tar.gz.
File metadata
- Download URL: chrome_custom_devices-1.0.10.tar.gz
- Upload date:
- Size: 19.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2b3d952b99ed4ee06a8f528ea7b1160c2ba62405ba01f9b59679edbeec15a1e
|
|
| MD5 |
2a143b071fa55574a0ae8db2898523f0
|
|
| BLAKE2b-256 |
cd8e2ddb061988904323ba870afc0deb8d3fd65842b8b2923aac8a94359b6b2f
|
File details
Details for the file chrome_custom_devices-1.0.10-py3-none-any.whl.
File metadata
- Download URL: chrome_custom_devices-1.0.10-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bc15c80b0fc7e350e01e0d7e2dc77da2662767bedf759a4506e79c5dc79b715
|
|
| MD5 |
9d674b0d356fbe7e2125e902879b3452
|
|
| BLAKE2b-256 |
eccb1b993c63859be49f0a48e80c380c718c0bdb1cca5e3141aa015c17a30689
|