https://github.com/oe/cors-unlocker
enable web app cors in modern browser
https://github.com/oe/cors-unlocker
chrome chrome-extension cors cors-unlocker unlocker
Last synced: 3 months ago
JSON representation
enable web app cors in modern browser
- Host: GitHub
- URL: https://github.com/oe/cors-unlocker
- Owner: oe
- Created: 2024-12-01T08:52:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-27T17:00:17.000Z (12 months ago)
- Last Synced: 2025-06-30T22:05:42.435Z (12 months ago)
- Topics: chrome, chrome-extension, cors, cors-unlocker, unlocker
- Language: TypeScript
- Homepage: http://cors.forth.ink/
- Size: 3.23 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# CORS Unlocker
[](https://opensource.org/licenses/MIT)
[](https://chrome.google.com/webstore)
[](https://addons.mozilla.org)
[](https://www.npmjs.com/package/cors-unlocker)
**ð Instantly unlock CORS restrictions for seamless API testing and cross-origin development**
[ð Website](https://cors.forth.ink) | [ð Documentation](https://cors.forth.ink) | [ðĶ NPM Package](https://www.npmjs.com/package/cors-unlocker)
## âĻ Features
- **ð One-Click CORS Unlock** - Enable/disable CORS restrictions with a single click
- **ðŊ Smart Credentials Support** - Automatically handles authentication headers
- **⥠Zero Configuration** - Works out of the box, no setup required
- **ðŠķ Lightweight & Fast** - Minimal impact on browser performance
- **ð ïļ Developer-Friendly** - Built by developers, for developers
- **ðĶ NPM Integration** - Programmatic CORS management for your applications
- **ð Cross-Browser Support** - Chrome, Firefox, and Edge compatible
- **ð Privacy-First** - No data collection, works entirely locally
## ð Quick Start
### Browser Extension
1. **Install from Store:**
- [Chrome Web Store](https://chrome.google.com/webstore)
- [Firefox Add-ons](https://addons.mozilla.org)
- [Microsoft Edge Add-ons](https://microsoftedge.microsoft.com/addons)
2. **Enable CORS:**
- Click the CORS Unlocker icon in your browser toolbar
- Toggle CORS for the current tab
- Make your cross-origin requests without restrictions
### NPM Package
```bash
npm install cors-unlocker
```
```javascript
import { enable, disable, isExtInstalled } from 'cors-unlocker';
// Check if extension is installed
const installed = await isExtInstalled();
// Enable CORS for current page
await enable();
// Enable with credentials support
await enable({ credentials: true });
// Disable CORS
await disable();
```
## ðïļ Project Structure
This is a monorepo containing multiple packages:
```
cors-unlocker/
âââ packages/
â âââ browser-extension/ # Browser extension (Chrome, Firefox, Edge)
â âââ npm/ # NPM package for developers
â âââ website/ # Documentation and demo website
âââ docs/ # Additional documentation
âââ README.md # This file
```
## ðĶ Packages
### Browser Extension
Cross-browser extension that enables CORS bypass functionality:
- **Chrome/Edge**: Uses `declarativeNetRequest` API
- **Firefox**: Content script bridge for external communication
- **Features**: Popup interface, settings page, tab-specific control
### NPM Package (`cors-unlocker`)
Lightweight JavaScript package for programmatic CORS management:
- **Size**: ~1.7KB gzipped
- **Formats**: ES modules and UMD
- **TypeScript**: Full type definitions included
- **Browser Support**: Chrome, Firefox, Edge
### Website
Documentation and demo site built with Astro:
- **Live Demo**: Interactive CORS testing interface
- **Documentation**: Complete API reference and guides
- **Playground**: Test the extension functionality
## ð ïļ Development
### Prerequisites
- Node.js 18+
- pnpm (recommended) or npm
### Setup
```bash
# Clone the repository
git clone https://github.com/yourusername/cors-unlocker.git
cd cors-unlocker
# Install dependencies
pnpm install
# Start development servers
pnpm dev
```
### Build
```bash
# Build all packages
pnpm build
# Build specific package (from root)
pnpm dev:extension # Extension development
pnpm dev:website # Website development
pnpm dev:cors-unlocker # NPM package development
```
### Package Scripts
```bash
# Development
pnpm dev # Start all dev servers
pnpm dev:extension # Extension development only
pnpm dev:website # Website development only
pnpm dev:cors-unlocker # NPM package development
# Building
pnpm build # Build all packages
```
## ðŊ Use Cases
### API Testing & Development
```javascript
// Perfect for testing APIs during development
await enable({ credentials: true });
const response = await fetch('https://api.example.com/data');
```
### Cross-Origin Integration
```javascript
// Seamless third-party service integration
await enable();
const result = await fetch('https://third-party-api.com/endpoint');
```
### Automated Testing
```javascript
// Include in your test setup
beforeEach(async () => {
if (await isExtInstalled()) {
await enable();
}
});
```
## ð Privacy & Security
- **Local Operation**: All functionality works entirely in your browser
- **No Data Collection**: We don't collect, store, or transmit any user data
- **Tab-Specific**: Only affects tabs where you explicitly enable CORS
- **Open Source**: Fully transparent and auditable code
- **Secure by Default**: Automatically disables when not needed
## ð Browser Support
| Browser | Extension | NPM Package |
|---------|-----------|-------------|
| Chrome | â
| â
|
| Firefox | â
| â
|
| Edge | â
| â
|
| Safari | â | â |
## ð Documentation
- **[Getting Started](https://cors.forth.ink/docs)** - Quick setup guide
- **[API Reference](https://cors.forth.ink/docs)** - Complete API documentation
- **[Examples](https://cors.forth.ink/playground)** - Common use cases and examples
- **[FAQ](https://cors.forth.ink/faq)** - Common questions and answers
## ðĪ Contributing
We welcome contributions! Please see our [Contributing Guide](DEVELOPMENT.md) for details.
### Development Workflow
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
## ð License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## ð Acknowledgments
- Built with [Vite](https://vitejs.dev/) and [TypeScript](https://www.typescriptlang.org/)
- UI components powered by [React](https://reactjs.org/) and [Tailwind CSS](https://tailwindcss.com/)
- Icons from [Lucide](https://lucide.dev/)
- Website built with [Astro](https://astro.build/)
## ð Support
- **Documentation**: [cors.forth.ink](https://cors.forth.ink)
- **Issues**: [GitHub Issues](https://github.com/yourusername/cors-unlocker/issues)
- **Discussions**: [GitHub Discussions](https://github.com/yourusername/cors-unlocker/discussions)
---
**â Star this repository if CORS Unlocker helps your development workflow!**
Made with âĪïļ by developers, for developers.