https://github.com/apify/idcac
I Don't Care About Cookies extension compiled for use with Playwright/Puppeteer
https://github.com/apify/idcac
Last synced: 8 months ago
JSON representation
I Don't Care About Cookies extension compiled for use with Playwright/Puppeteer
- Host: GitHub
- URL: https://github.com/apify/idcac
- Owner: apify
- License: gpl-3.0
- Created: 2023-05-26T12:28:22.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-09-09T06:13:27.000Z (almost 2 years ago)
- Last Synced: 2025-06-22T07:46:28.660Z (12 months ago)
- Language: JavaScript
- Size: 41 KB
- Stars: 15
- Watchers: 5
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# I Don't Care About Cookies for Playwright/Puppeteer
This package contains the [I don't care about cookies](https://addons.mozilla.org/cs/firefox/addon/i-dont-care-about-cookies/) browser extension compiled for use with Playwright or Puppeteer.
## Usage
```typescript
import { chromium } from 'playwright'; // works with Firefox too!
import { getInjectableScript } from 'idcac-playwright';
(async () => {
const b = await chromium.launch({
headless: false,
});
const context = await b.newContext();
const p = await context.newPage();
await p.goto('https://google.com');
// Inject the extension as a client-side script
await p.evaluate(getInjectableScript());
// Enjoy your webpage without annoying cookie modals!
})();
```
## What works:
- Custom CSS injection
- Custom JS injection
## WIP
- Network interception
- trying to figure out the best way to do this with Playwright
## What doesn't work:
- Whitelisting (just don't inject the script on the page you want to whitelist)