A powerful Chrome extension that packages Swagger UI, allowing you to easily view and test OpenAPI/Swagger documentation directly in your browser. Perfect for API developers and testers who want quick access to API documentation without setting up a local server.
- 🚀 Instant Access - View Swagger/OpenAPI documentation with one click
- 🎨 Multiple Themes - Choose from various built-in themes or load custom themes from GitHub
- 📁 Local File Support - Open local JSON/YAML API documentation files
- 🔗 URL Support - Load API documentation from any URL
- 💾 Persistent Settings - Your theme preferences are saved automatically
- 🔒 Secure - Runs locally in your browser with minimal permissions
- Visit the Chrome Web Store
- Click "Add to Chrome"
- Confirm the installation
-
Clone the repository:
git clone https://github.com/jiayx/swagger-ui-chrome.git cd swagger-ui-chrome -
Update Swagger UI to the latest version:
./scripts/update.sh
-
Load the extension in Chrome:
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top right
- Click "Load unpacked"
- Select the project root directory
- Open Chrome and navigate to
- Click the extension icon in your Chrome toolbar
- Enter the API documentation URL
- View and interact with your API documentation
- Right-click the extension icon and select "Options"
- Browse available themes:
- GitHub themes - Dynamically loaded from GitHub repositories
- Themes are fetched from configured repositories in real-time
- Preview themes with screenshots (when available)
- Click on a theme card to select it
- Click "Save Theme" to apply the selected theme
This extension packages Swagger UI as a Chrome extension with the following architecture:
- Service Worker (
background.js): Handles extension icon clicks and opens Swagger UI in a new tab - Swagger UI Integration: Uses the official Swagger UI distribution with a custom initializer
- Theme System: Dynamically fetches and applies CSS themes from GitHub repositories
- Storage: Uses Chrome's storage API to persist user preferences (selected URL and theme)
- Manifest V3: Compliant with Chrome's latest extension architecture for better security and performance
- Git
- Chrome browser
- Basic knowledge of Chrome extensions
swagger-ui-chrome/
├── swagger-ui/ # Swagger UI distribution files
│ ├── index.html # Main Swagger UI page
│ ├── swagger-ui-bundle.js # Swagger UI core bundle
│ ├── swagger-ui.css # Swagger UI styles
│ └── swagger-initializer.js # Custom initialization
├── src/ # Extension source code
│ ├── background.js # Service worker for extension
│ ├── swagger-initializer.js # Template for Swagger UI initialization
│ ├── options.html # Theme settings page
│ └── options.js # Theme management logic
├── scripts/ # Build and update scripts
│ ├── fetch_assets.sh # Fetch Swagger UI and themes
│ └── update.sh # Main update script
├── _locales/ # Internationalization files
│ ├── en/ # English messages
│ └── zh_CN/ # Chinese messages
├── manifest.json # Extension manifest (V3)
└── LICENSE # MIT License
-
Make your changes to the source code
-
Test locally by loading the unpacked extension
-
Run update script to fetch the latest Swagger UI and themes:
./scripts/update.sh
This script will:
- Download the latest Swagger UI distribution
- Fetch theme collections from GitHub repositories
- Clean up unnecessary files
- Copy custom initialization script
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This extension dynamically loads themes from:
This project is licensed under the MIT License - see the LICENSE file for details.
- Swagger UI - The amazing API documentation tool
- Theme creators ilyamixaltik/swagger-themes
- Theme creators ostranme/swagger-ui-themes
- All contributors who have helped improve this extension
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Theme changes now take effect immediately after saving, no page refresh required
- Added support for more languages
- Migrated to Manifest V3
- Improved theme management system
- Added local theme support
- Enhanced settings page UI/UX
- Better error handling and user feedback
- Added multiple theme support
- Improved performance
- Initial release
- Basic Swagger UI functionality