Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
playwright-blocker — A plugin library for any Playwright-based library that allows blocking ads, domains, and resource types through injectors. | Kitploit
Tools/GitHubGitHub/d4vinci/playwright-blocker
Web SecurityPrivacyUtilities & FrameworksCrawlerAnti-Bot
GitHubd4vinci/playwright-blocker

playwright-blocker

A plugin library for any Playwright-based library that allows blocking ads, domains, and resource types through injectors.

View Repository
4Dec 5, 2026Not yet reviewed

Related Tools

  • zaproxy

    Open-source web application security scanner for automated vulnerability detection, manual penetration testing, and API security testing with a proxy-based interception engine.

  • nuclei

    Fast YAML-based vulnerability scanner with template-driven detection engine for automated security testing across web apps, APIs, networks, DNS, and cloud infrastructure.

  • sqlmap

    Automatic SQL injection and database takeover tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    Callisto

    jetp1ane/callisto

    Automated binary vulnerability analysis tool that decompiles executables via Ghidra, scans pseudo-C code with Semgrep, and validates findings using GPT-3.5-Turbo to reduce false positives.

    2.1k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    One-tap Android kernel exploit app for CVE-2026-43499, providing privilege escalation via kernel module loading, with offset extraction and on-device analysis tools.

    759
  • 3

    IMSIcatcher

    28zaaky/imsicatcher

    IMSI Catcher platform that deploys a rogue GSM cell to intercept SMS, inject messages and track mobile devices

    625
  • 4

    DFRoot

    a2333c/dfroot

    Android root tool for Samsung Galaxy S25 Ultra (SM-S938B) that chains DirtyFrag CVE-2026-43284 and CVE-2026-43499 to gain root automatically at boot via KernelSU.

    451
  • 5

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    415
  • 6

    opencti

    opencti-platform/opencti

    Open Cyber Threat Intelligence Platform

    374

Explore all tools

Browse our collection of tools

View all tools →
Share

playwright-blocker

A plugin library for any Playwright-based library that allows blocking ads, domains, and resource types through injectors. Supports sync and async pages.

This library was ported from the blocking code inside Scrapling.

The package uses only the Python standard library.

Install

Requires Python 3.10 or newer.

python -m pip install playwright-blocker

Sync

from playwright.sync_api import sync_playwright
from playwright_blocker import inject

with sync_playwright() as playwright:
    browser = playwright.chromium.launch()
    try:
        context = browser.new_context(service_workers="block")
        page = context.new_page()
        inject(page)
        page.goto("https://example.com")
        print(page.title())
    finally:
        browser.close()

Async

import asyncio

from playwright.async_api import async_playwright
from playwright_blocker import inject_async


async def main():
    async with async_playwright() as playwright:
        browser = await playwright.chromium.launch()
        try:
            context = await browser.new_context(service_workers="block")
            page = await context.new_page()
            await inject_async(page)
            await page.goto("https://example.com")
            print(await page.title())
        finally:
            await browser.close()


asyncio.run(main())

These examples use Playwright. The same inject and inject_async calls work with pages from any Playwright-based library.

Options

Both functions take a page as their first argument. Set the other arguments by name.

ArgumentDefaultEffect
block_adsTrueBlock the bundled ad and tracking domains.
blocked_domainsNoneAdd domain names to block. Accepts a set or another iterable of strings.
disable_resourcesFalseBlock the resource types listed below.

Logging is automatic. Blocked requests are logged at DEBUG level.

handler = inject(
    page,
    blocked_domains={"ads.example.com", "tracker.example.net"},
    disable_resources=True,
)

Use lowercase hostnames without a scheme, path or port. A domain also blocks its subdomains: example.com matches cdn.example.com, but does not match notexample.com. Input sets are copied and are not changed.

Bundled ad domains are allowed when navigating the main page. Ad scripts, images, and iframes are still blocked. Domains passed in blocked_domains also block main-page navigation.

disable_resources=True blocks these resource types: font, image, media, beacon, object, imageset, texttrack, websocket, csp_report, and stylesheet. Only resource types reported by the driver's HTTP route API can be blocked. This option does not intercept WebSocket connections.

To use only your own domains, pass block_ads=False. If all options are off, no route is added.

Development

From this directory:

python -m pip install -e ".[test]" mypy pyright ruff build twine tox
python -m playwright install chromium
python -m patchright install chromium
python -m pytest
mypy src/
pyright
ruff check .
ruff format --check .
python -m build
python -m twine check dist/*

The browser tests run in sequence and use a local HTTP server. They check sync and async page routing and reject browser contexts.

Domain list and license

The bundled domains were extracted from Peter Lowe's ad and tracking server list, using its plain hostname format. Source credit is also kept in the data module.

The code is under the BSD 3-Clause license.


Designed & crafted with ❤️ by Karim Shoair.

Download Tool