Automatically block cookie consent popups and trackers across the web.
Cookie Blocker is a Chrome browser extension that removes cookie consent banners, blocks tracking scripts, and helps you browse the web without interruptions. It uses network-level blocking combined with intelligent DOM manipulation to provide a seamless browsing experience.
π Install from Chrome Web Store
This project is licensed under the GNU General Public License v3.0 (GPL-3.0).
This extension is a derivative work based on I Still Don't Care About Cookies, which is also licensed under GPL-3.0.
- Original work: Copyright (c) I-Still-Dont-Care-About-Cookies contributors
- Modifications: Copyright (c) Cookie Blocker contributors
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- Network-Level Blocking: Uses Declarative Net Request API to block cookie consent scripts before they load
- Automatic Banner Removal: Intelligently detects and removes cookie consent popups via DOM manipulation
- Tracker Blocking: Blocks known tracking scripts and cookies
- Customizable Settings: Fine-tune blocking behavior through the extension popup and options page
- Lightweight & Fast: Optimized build with minified assets and efficient rule matching
- Open Source: Fully transparent and community-driven
Cookie Blocker operates on multiple levels to ensure cookie banners are effectively blocked:
- Declarative Net Request Rules (
rules.json): Blocks known cookie consent scripts and styles at the network level before they execute - Content Scripts: Injected scripts that handle remaining cookie banners through:
- DOM manipulation and element hiding
- Automatic "Accept" button clicking
- Storage cleanup (cookies, localStorage, sessionStorage)
- Popup UI: Quick-access controls to enable/disable blocking and adjust settings
- Options Page: Detailed configuration for advanced users
src/
βββ background/index.js # Service worker β core logic, rules management, tab state, badges
βββ popup.{html,css,js} # Extension popup β quick toggle + settings
βββ options.{html} # Options page (also used as side panel)
βββ options/index.{css,js} # Options page scripts and styles
βββ rules.js # JS rules: block URLs, commons, handlers
βββ rules.json # Declarative Net Request rules for network-level blocking
βββ data/js/ # Content script handlers (cookie, click, storage, Google, embeds)
βββ data/css/ # Shared CSS for content scripts
βββ img/ # Extension icons (16β128px)
βββ assets/ # Static assets
βββ _locales/ # i18n localization files
βββ tailwind.css # Tailwind CSS entry point
| Component | Purpose |
|---|---|
background/index.js |
Service worker: manages rules, tab state, settings, badges, event listeners |
rules.json |
Declarative Net Request rules for network-level blocking |
rules.js |
JS-based rules and common handlers merged with background |
data/js/*.js |
Content scripts injected into pages (cookie handling, click automation, storage cleanup) |
popup/ |
Quick-access popup UI |
options/ |
Full settings page (also configured as side panel) |
- Runtime: Chrome Extension Manifest V3
- Build: Vite 5 + CRXJS (
@crxjs/vite-plugin) - Styling: Tailwind CSS 4
- Minification: esbuild (post-build script)
- Scripts: Node.js (ESM)
- Node.js (v18 or higher)
- npm
npm installStart the development server with hot reload:
npm run devBuild the extension for production:
npm run buildThis creates an optimized, minified build in the build/ directory.
- Run
npm run build - Open Chrome and navigate to
chrome://extensions - Enable Developer mode (toggle in the top-right corner)
- Click Load unpacked and select the
build/directory
| Command | Description |
|---|---|
npm install |
Install dependencies |
npm run dev |
Start development server with hot reload |
npm run build |
Production build to build/ (minified + optimized) |
npm run preview |
Preview the build output |
npm run sync-issues |
Sync GitHub issues (uses .env for token) |
npm run sync-issues:test |
Test sync-issues script |
npm run sync-issues:combine |
Combine extracted PRs |
The build process (build/ directory) produces:
- Background service worker +
rules.jsbundled into a single minified chunk - Popup and options scripts bundled and minified
- data/js/ and data/css/common.css copied then minified via post-build script (
scripts/minify-data.mjs) - rules.json compacted (whitespace removed)
| File | Purpose |
|---|---|
manifest.js |
Extension manifest definition (permissions, icons, background, DNR rules) |
vite.config.js |
Vite build config with CRXJS plugin, Tailwind, static copy |
package.json |
Dependencies, scripts, version info |
The extension requests:
tabs,storage,webRequest,webNavigationdeclarativeNetRequestWithHostAccessscripting,sidePanel- Host permissions:
http://*/*,https://*/*
Contributions are welcome! Since this project is based on I Still Don't Care About Cookies, please ensure any contributions comply with the GPL-3.0 license.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This extension respects your privacy:
- No personal data is collected or transmitted
- All blocking rules run locally on your machine
- No analytics or tracking embedded in the extension itself
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
Original project: I Still Don't Care About Cookies (GPL-3.0)
- π Report Bugs: Open an issue
- π‘ Feature Requests: Open an issue
- π§ Contact: Via GitHub Issues
Enjoy browsing without cookie banners! πͺπ«