Skip to main content

CDP Chrome Tabs

A Python package for interacting with Chrome tabs via the Chrome DevTools Protocol.

Installation

pip install cdp-chrome-tabs

Or install from source:

git clone https://github.com/guocity/cdp-chrome-tabs.git
cd cdp-chrome-tabs
pip install -e .

Prerequisites

For this package to work, Chrome must be running with remote debugging enabled. You can start Chrome with:

# On macOS
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222

# On Windows
"C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222

# On Linux
google-chrome --remote-debugging-port=9222

Usage

from cdp_chrome_tabs import ChromeTabs


# one line print active tab
print(f"Active Tab URL: {ChromeTabs().get_active_tab().url if ChromeTabs().get_active_tab() else 'No active tab'}")

# Get all tabs
tabs = chrome.get_all_tabs()
for tab in tabs:
    print(f"Tab ID: {tab.id}")
    print(f"Title: {tab.title}")
    print(f"URL: {tab.url}")
    print("---")

# Get the active tab
active_tab = chrome.get_active_tab()
if active_tab:
    print(f"Active tab: {active_tab.title} - {active_tab.url}")

# Find a tab by ID
tab = chrome.get_tab_by_id("some-tab-id")

# Find a tab by URL (exact match)
tab = chrome.get_tab_by_url("https://www.example.com")

# Find a tab by URL (partial match)
tab = chrome.get_tab_by_url("example.com", partial_match=True)

License

MIT

Metadata

Release files for cdp-chrome-tabs 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cdp-chrome-tabs 0.1.0
File Size Uploaded Provenance Actions
cdp_chrome_tabs-0.1.0.tar.gz 7.1 kB Without provenance Details for cdp_chrome_tabs-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cdp-chrome-tabs 0.1.0
File Interpreter ABI Platform Actions
cdp_chrome_tabs-0.1.0-py3-none-any.whl Python 3 none any Details for cdp_chrome_tabs-0.1.0-py3-none-any.whl

Total release size: 11.6 kB

Release files / cdp_chrome_tabs-0.1.0.tar.gz

Download URL cdp_chrome_tabs-0.1.0.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d8410c8248624cd1da6fd74b8ce1ee63c1c70ee1ba908c5a3ee0e11914f88b4f
BLAKE2b-256 checksum
How to use checksums
72d54045d70ffb6583968a32ffcd67306511f94457853bf6635fb1d0392b6ba6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / cdp_chrome_tabs-0.1.0-py3-none-any.whl

Download URL cdp_chrome_tabs-0.1.0-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6beb2db73da24f4dd71a718a4ec609b17bac29905994035530668a95df8d5fa2
BLAKE2b-256 checksum
How to use checksums
6b9be8d8f171bf65799be15eadb229e439753aa310e94ea923127b7249369e8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Security for cdp-chrome-tabs 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page