Pre-built DuckDuckGo autoconsent JS bundle for use with Playwright (no Node.js required)
Project description
duckduckgo-autoconsent-py
Pre-built DuckDuckGo autoconsent JS bundle for use with Playwright — no Node.js required.
The JS assets are baked into the wheel at publish time. Installing this package gives you the bundle and CMP rules as Python strings, ready to inject into any Playwright page.
Installation
pip install duckduckgo-autoconsent-py
Usage
from duckduckgo_autoconsent import bundle, rules_json
# Inject into a Playwright page after navigation
await page.add_script_tag(content=bundle())
await page.evaluate(
"""(args) => new Promise(resolve => {
window.__acResolve = resolve;
window.autoconsentReceiveMessage({
type: 'initResp',
config: { autoAction: 'optOut' },
rules: { autoconsent: JSON.parse(args.rules_json), consentomatic: {} }
});
setTimeout(() => resolve('timeout'), args.timeout_ms);
})""",
{"rules_json": rules_json(), "timeout_ms": 3000},
)
Versioning
The package version mirrors the bundled @duckduckgo/autoconsent npm version.
duckduckgo-autoconsent-py==14.86.0 bundles @duckduckgo/autoconsent@14.86.0.
License
MPL-2.0 — same as the upstream autoconsent library.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file duckduckgo_autoconsent_py-14.86.0.tar.gz.
File metadata
- Download URL: duckduckgo_autoconsent_py-14.86.0.tar.gz
- Upload date:
- Size: 68.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a74989d7f1295a19ce469726454d42bbd8c2fd2c1253da69daf261d8a9c9599
|
|
| MD5 |
6549690710c6e03a481220c986457b0c
|
|
| BLAKE2b-256 |
7a82d77e332445f1b870c5edfb248bdb5aae0db88f913eb89c3ca6add8219d76
|
File details
Details for the file duckduckgo_autoconsent_py-14.86.0-py3-none-any.whl.
File metadata
- Download URL: duckduckgo_autoconsent_py-14.86.0-py3-none-any.whl
- Upload date:
- Size: 68.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f2376d5dcf18cff2bf3f123b4e9061d56938d99b876c4373af824db3973f0ed
|
|
| MD5 |
f907fb12ab15bcddfa03825c2f6ce520
|
|
| BLAKE2b-256 |
e159b427888c86dc0899a30a7309e067371eb384d18300d067883683af241905
|