Skip to content

Repository files navigation

CORS Unlocker

License: MIT Chrome Web Store Firefox Add-ons npm version

πŸš€ Instantly unlock CORS restrictions for seamless API testing and cross-origin development

🌐 Website | πŸ“– Documentation | πŸ“¦ NPM Package

✨ 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:

  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

npm install cors-unlocker
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

# 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

# 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

# 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

// Perfect for testing APIs during development
await enable({ credentials: true });
const response = await fetch('https://api.example.com/data');

Cross-Origin Integration

// Seamless third-party service integration
await enable();
const result = await fetch('https://third-party-api.com/endpoint');

Automated Testing

// 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

🀝 Contributing

We welcome contributions! Please see our Contributing Guide 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 file for details.

πŸ™ Acknowledgments

πŸ“ž Support


⭐ Star this repository if CORS Unlocker helps your development workflow!

Made with ❀️ by developers, for developers.

About

enable web app cors in modern browser

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages