A modern Chrome extension for managing PAC (Proxy Auto Configuration) scripts with an intuitive interface. This extension allows you to configure proxy settings, manage PAC scripts, set domain exceptions, and control proxy servers through a clean, responsive UI.
- PAC Script Management: Add, edit, and manage multiple PAC scripts from URLs or direct content
- Domain Exceptions: Configure domain-specific proxy rules with granular control
- Proxy Server Configuration: Set up and manage custom proxy servers
- Smart Proxy Logic: Intelligent proxy selection based on domain exceptions and PAC script results
- Modern Design: Built with React, Tailwind CSS, and Headless UI components
- Responsive Layout: Clean, tabbed interface with skeleton loading states
- Icon Integration: Uses Heroicons for consistent iconography
- Toast Notifications: Real-time feedback with react-hot-toast
- Multi-language Support: Available in English and Russian
- IndexedDB Storage: Efficient local storage for configuration data
- Manifest V3: Uses the latest Chrome extension architecture
- Comprehensive Testing: Unit tests with Vitest and Testing Library
- Modern Build System: Vite-based build process with hot reload
- Google Chrome or Chromium-based browser
- Chrome Extensions Developer Mode enabled (for development)
- Download the latest release from the GitHub releases page
- Extract the ZIP file
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top-right corner
- Click "Load unpacked" and select the extracted folder
-
Clone the repository:
git clone https://github.com/ilyachase/pac-proxy-manager-extension.git cd pac-proxy-manager-extension -
Install dependencies:
npm install
-
Build the extension:
npm run build
-
Load the extension in Chrome:
- Navigate to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked" and select the
distfolder
- Navigate to
- Click the extension icon in your browser toolbar
- Navigate to the "PAC Scripts" tab
- Add PAC scripts by URL or paste script content directly
- Enable/disable scripts using the toggle switches
- Edit or delete scripts using the action buttons
- Go to the "Exceptions" tab
- Enter a domain (supports wildcards like
*.example.com) - Choose the proxy behavior:
- PAC: Use PAC script rules (default)
- Yes: Always use configured proxy servers
- No: Always connect directly
- Use bulk import for multiple domains
- Switch to the "Proxy Servers" tab
- Add proxy servers in the format
type://host:port- Supported types:
http,https,socks4,socks5 - Example:
http://proxy.example.com:8080
- Supported types:
- Toggle the master proxy switch to activate/deactivate all proxies
The extension follows this priority order:
- Domain Exceptions (highest priority)
- PAC Script Results (if no exception found)
- Direct Connection (fallback)
The extension uses a sophisticated proxy logic that separates user proxy controls from PAC script execution:
graph TD
A[System Start / PAC Script Changes] --> B{Has Enabled PAC Scripts?}
B -->|Yes| C[Activate Proxy System with PAC Scripts]
B -->|No| D[Deactivate Proxy System]
E[User Proxy Toggle] -->|ON| F[Enable User Proxies]
E -->|OFF| G[Disable User Proxies]
F --> H[Update PAC Script with User Proxy Override]
G --> I[Update PAC Script without User Proxy Override]
C --> J[Generate PAC Script Logic]
H --> J
I --> J
J --> K{User Proxies Enabled?}
K -->|Yes| L[Include Domain Exception Logic<br/>Override PAC proxy choices with user proxies]
K -->|No| M[Skip Domain Exception Logic<br/>Use PAC script results directly]
L --> N[PAC Script with Exceptions & User Override]
M --> O[PAC Script Direct Mode]
N --> P[Final PAC Script Applied]
O --> P
Different combinations of user proxies and PAC scripts result in different behaviors:
graph TD
A[Proxy Configuration Scenarios] --> B[Scenario 1: Only User-Defined Proxies]
A --> C[Scenario 2: Only PAC Scripts]
A --> D[Scenario 3: Both User Proxies & PAC Scripts]
A --> E[Scenario 4: PAC Scripts All Disabled]
A --> F[Scenario 5: User Proxy Toggle OFF]
B --> B1[User Toggle: Available for activation]
B --> B2[PAC Scripts: None]
B1 --> B3[Toggle ON: User proxies + exceptions active<br/>Toggle OFF: No proxy system]
B2 --> B3
C --> C1[User Toggle: Disabled - no user proxies]
C --> C2[PAC Scripts: Work automatically]
C1 --> C3[Result: PAC Scripts work independently<br/>No domain exceptions, no user override]
C2 --> C3
D --> D1[User Toggle: Controls user proxy layer only]
D --> D2[PAC Scripts: Always active when enabled]
D1 --> D3[Toggle ON: PAC decides IF + User proxies decide WHERE<br/>Toggle OFF: PAC scripts work directly]
D2 --> D3
E --> E1[PAC Scripts: All Disabled]
E1 --> E2[Result: Only user proxies work when toggle ON<br/>No proxy system when toggle OFF]
F --> F1[User Proxy Toggle: OFF]
F1 --> F2[Result: PAC scripts work independently<br/>No domain exceptions, no user override]
The extension ensures complete independence between PAC scripts and user proxy settings:
graph TB
A["User Proxy Toggle"] --> A1["Only affects proxyActive flag"]
B["PAC Script Toggle"] --> B1["Only affects PAC script enabled state"]
A1 --> C["Combined Logic Check"]
B1 --> C
C --> D{"Both Disabled?"}
D -->|Yes| E["Clear All Proxy Settings"]
D -->|No| F["Generate Combined PAC Script"]
F --> G["Include User Proxies if enabled"]
F --> H["Include PAC Scripts if enabled"]
style A fill:#e3f2fd
style B fill:#e8f5e8
style C fill:#fff3e0
style F fill:#f3e5f5
- User Proxy Toggle: Controls user-defined proxies and domain exceptions only
- PAC Scripts: Work independently when user proxy toggle is OFF
- Domain Exceptions: Only active when user proxies are enabled
- Combined Mode: PAC scripts determine routing logic, user proxies determine actual proxy servers
# Install dependencies
npm install
# Start development build with watch mode
npm run dev
# π Run all development tools in parallel (Recommended)
npm run dev:all:watch
# Build for production
npm run build
# Run tests
npm test
# Run linting
npm run lint
# Fix linting issues
npm run lint:fixThe dev:all:watch command provides a comprehensive development environment by running build, test, and lint processes simultaneously with color-coded output for easy monitoring:
- π¦ [build] - Vite development server with hot reload (cyan)
- π₯ [test] - Vitest in watch mode for continuous testing (magenta)
- π¨ [lint] - Biome linter with auto-fix on file changes (yellow)
- Parallel Processing: All tools run simultaneously, no waiting between steps
- Real-time Feedback: See build, test, and lint results instantly as you code
- Auto-fix Linting: Biome automatically fixes formatting issues when you save files
- Visual Clarity: Color-coded prefixes make it easy to distinguish different outputs
- Efficient Development: Catch issues early with continuous validation
# Start the full development environment
npm run dev:all:watch
# Output example:
# [build] Build completed in 2.3s
# [test] β All tests passed
# [lint] Checked 12 files in 23ms. Fixed 2 files.npm run dev- Build onlynpm run test:watch- Tests onlynpm run lint:watch- Linting only
src/
βββ background.js # Service worker with proxy logic
βββ popup/
β βββ PopupApp.jsx # Main popup component
β βββ popup.html # Popup HTML template
β βββ popup.css # Popup styles
β βββ components/ # Reusable components
β βββ tabs/ # Tab components
β βββ PacScriptsTab.jsx
β βββ ExceptionsTab.jsx
β βββ ProxiesTab.jsx
β βββ AboutTab.jsx
βββ utils/
β βββ indexedDB.js # IndexedDB wrapper
_locales/
βββ en/messages.json # English translations
βββ ru/messages.json # Russian translations
tests/ # Test files
npm run build- Build for productionnpm run dev- Development build with watch modenpm run dev:all:watch- π Recommended: Run build, test, and lint in parallel with color-coded outputnpm test- Run test suite oncenpm run test:watch- Run tests in watch modenpm run lint- Check code stylenpm run lint:fix- Auto-fix linting issuesnpm run lint:watch- Run linter in watch mode with auto-fix
The extension includes comprehensive tests:
# Run all tests
npm test
# Run tests with UI
npx vitest --ui
# Run specific test file
npx vitest tests/background.test.jsTest coverage includes:
- Background service worker functionality
- Component rendering and interactions
- Proxy logic validation
- Storage operations
The extension supports multiple languages through Chrome's i18n API:
- English (
en) - Default language - Russian (
ru) - Full translation available
To add a new language:
- Create a new folder in
_locales/with the language code - Copy
messages.jsonfrom theenfolder - Translate the message values
- Update the
default_localeinmanifest.jsonif needed
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-feature - Make your changes and add tests
- Run the test suite:
npm test - Commit your changes:
git commit -m 'Add new feature' - Push to the branch:
git push origin feature/new-feature - Submit a pull request
- Use ESLint configuration provided in the project
- Follow React best practices
- Write tests for new functionality
- Use semantic commit messages
This project is open source and available under the MIT License.
Created by Ilya L.
- Buy Me a Coffee: Buy Me a Coffee
- Boosty (for Russian users): Boosty
The extension requires the following permissions:
proxy- To modify proxy settingsactiveTab- To access current tab informationstorage- To save configuration data
- Chrome (Manifest V3)
- Edge (Chromium-based)
- Other Chromium-based browsers
- Uses Chrome's local storage API for configuration
- IndexedDB for complex data structures
- All data is stored locally on the user's device
For testing with different locales, you can start Chrome with a specific language:
Test en locale:
start "Chrome-EN" "C:\Program Files\Google\Chrome\Application\chrome.exe" --user-data-dir="%TEMP%\chrome-english-test" --lang=en