צילומי מסך
תיאור
A Chrome extension that helps handle cross-origin requests.
This Chrome extension helps handle cross-origin requests. It can automatically add the necessary CORS headers to requests so that cross-origin requests work properly.
## Features
- Automatically adds CORS-related request and response headers
- Supports all common HTTP methods (GET, POST, PUT, DELETE, OPTIONS)
- Simple on/off control with persistent state
- Supports dynamically adding and managing a domain list
- Automatically obtains the domain of the current website
- Supports cross-origin requests for all websites
- Completely stops cross-origin processing when disabled
## Installation
1. Open Chrome and go to the extension management page (chrome://extensions/)
2. Enable "Developer mode" in the upper-right corner
3. Click "Load unpacked"
4. Select the folder containing this extension
## Usage
1. After installation, click the extension icon in the Chrome toolbar
2. View the current cross-origin processing status in the popup
3. Use the switch to enable or disable cross-origin processing at any time
4. The extension automatically displays the current website's domain
5. If the current domain has not been added, click "Add current domain" to add it to the processing list
6. If the current domain has been added, click "Remove current domain" to remove it from the list
7. Click "Manage domains" to switch to the domain management screen
8. View and delete added domains on the domain management screen
9. Click "Back" to return to the main screen
## Interface
### Main screen
- Displays the extension status and on/off control
- Displays the current website's domain
- Provides an option to add the current domain
- The "Manage domains" button opens the domain management screen
### Domain management screen
- Displays a list of all added domains
- Provides domain statistics (total, custom domains, and default domains)
- Supports deleting custom domains (localhost is protected)
- The "Back" button returns to the main screen
## Domain management
- Includes the `localhost` domain by default (marked as "Default")
- Any number of domains can be added
- The extension automatically obtains the current tab's domain
- When visiting localhost, the add/remove button is not shown because localhost is a default domain
- If the current domain has been added, the button displays "Remove current domain" (red)
- If the current domain has not been added, the button displays "Add current domain" (green)
- The `localhost` domain is protected and cannot be deleted
- Other domains can be removed using the delete button
## Testing
The extension includes a test page (`test/test.html`) that can be used to verify that CORS functionality works correctly.
## Notes
- This extension is intended only for development and testing environments
- Use in production is not recommended
- Using this extension may introduce security risks; use it with care
- Added domains are saved persistently
- The `tabs` permission is required to obtain information about the current tab
## Technical details
- Uses Chrome Extension Manifest V3
- Modifies response headers through the declarativeNetRequest API
- Uses the Chrome Storage API to save settings and the domain list
- Uses the Chrome Tabs API to obtain current tab information
- Supports dynamic rule updates
- Complies with Chrome extension content security policy (CSP) requirements