Skip to main content

browsermem

Get the real-time URL of the active browser tab from Python. No extension, no WebDriver, no setup.

PyPI Python CI License: MIT Docs

import browsermem

browsermem.current_url()
# 'https://github.com/BinaryBreaker/browsermem'

browsermem reads the active tab's URL and title straight from the browser's memory, and sends an event every time you switch tabs, open a tab or navigate. It works with the browser you already use: the user doesn't need to install anything or restart the browser with special flags.

Features

  • Active tab: current_url(), get_active_tab(), or the active tab of every open window.
  • Live events: tab switched, new tab, navigation, browser window focused or closed.
  • Several ways to handle events: callbacks, decorators, iterators or async for.
  • Filters: @monitor.on_domain("youtube.com"), @monitor.on_url(r"/checkout"), and monitor.wait_for(...) to block until a matching page opens.
  • Activity tracking: TabHistory records visits and time spent per domain.
  • Browsers: Chrome, Edge, Brave, Opera and Vivaldi (any Chromium-based browser). Firefox is experimental.
  • Fast: event-driven (no polling loop in Python); about 0.1–0.5 s per lookup, with caching.
  • Command line: browsermem active, browsermem watch --json and more.
  • Typed and dependency-free: one wheel covers Python 3.9–3.14. Nothing to compile.
  • Bonus: memory forensics. Analyse minidumps of a browser offline.

Install

pip install browsermem

Requires Windows 10/11 (x64) and Python 3.9+.

Quick start

The active tab

import browsermem

tab = browsermem.get_active_tab()
print(tab.browser_name)   # Google Chrome
print(tab.title)          # BinaryBreaker/browsermem
print(tab.url)            # https://github.com/BinaryBreaker/browsermem
print(tab.domain)         # github.com

React to tab changes

from browsermem import TabMonitor, EventKind

monitor = TabMonitor()

@monitor.on(EventKind.TAB_CHANGED, EventKind.WINDOW_ACTIVATED)
def changed(tab):
    print(f"{tab.browser_name}: {tab.title} -> {tab.url}")

@monitor.on_domain("youtube.com")
def youtube(tab):
    print("Watching:", tab.title)

monitor.run_forever()   # Ctrl+C to stop

Iterate, or use asyncio

with TabMonitor() as monitor:
    for tab in monitor.events():
        print(tab.url)

async with TabMonitor() as monitor:
    async for tab in monitor.aevents():
        print(tab.url)

Wait for a page

with TabMonitor() as monitor:
    tab = monitor.wait_for(r"/payment/success", timeout=300)
    print("Done!" if tab else "Timed out")

Track browsing time

from browsermem import TabMonitor, TabHistory

monitor = TabMonitor()
history = TabHistory(monitor)
monitor.start()
# ... later
for domain, spent in history.time_by_domain().items():
    print(f"{domain:30} {spent}")

Command line

browsermem active                # URL of the active tab
browsermem windows               # all browser windows
browsermem watch                 # live tab events
browsermem watch --json          # JSON lines, ready to pipe

Events

EventKind When
SNAPSHOT Current state when the monitor starts (also returned by one-shot queries)
TAB_CHANGED Tab switch, new tab, or a navigation that changed the page title
WINDOW_ACTIVATED You switched to a browser window from another app or window
URL_CHANGED Same title, different URL (single-page apps). Needs rescan_ms
WINDOW_CLOSED A browser window closed; the event holds its last tab

How it works

  1. Windows notifies browsermem when a browser window gains focus or its title changes, which happens on every tab switch and navigation.
  2. browsermem takes a snapshot of the browser process's own memory (read-only, the same access Task Manager uses).
  3. It finds the tab's title in that memory, follows the pointers that refer to it, and picks the URL stored inside the same browser objects.

See How it works for details.

Supported browsers

Browser Status
Google Chrome ✅ tested
Microsoft Edge ✅ tested
Brave, Opera, Vivaldi, Yandex ✅ supported (same Chromium engine)
Firefox 🧪 experimental

Limitations

  • Windows x64 only for now.
  • A navigation that keeps the same page title is only detected with TabMonitor(rescan_ms=...).
  • Two tabs with exactly the same title can be confused.
  • browsermem only reads processes your user account can open (no elevation needed for your own browser).

Responsible use

browsermem reads memory of processes that belong to your user account. Use it for your own productivity tools, automation, research and authorised investigations. Monitoring other people's browsing without their knowledge and consent may be illegal where you live.

Contributing

Bug reports and pull requests are welcome. See CONTRIBUTING.md.

License

MIT © BinaryBreaker

Metadata

Release files for browsermem 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 browsermem 0.1.0
File Size Uploaded Provenance Actions
browsermem-0.1.0.tar.gz 55.1 kB With provenance Details for browsermem-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for browsermem 0.1.0
File Interpreter ABI Platform Actions
browsermem-0.1.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for browsermem-0.1.0-py3-none-win_amd64.whl

Total release size: 216.2 kB

Release files / browsermem-0.1.0.tar.gz

Download URL browsermem-0.1.0.tar.gz
Size 55.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ab1d03549a80ad3c3ef1475646736fa264e52250c0b52f68c2f0575250fa80ca
BLAKE2b-256 checksum
How to use checksums
e196dbd32af42512de692dfe119f2ba77b3a48e316aa82e2645f52eb9f4c76b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / browsermem-0.1.0-py3-none-win_amd64.whl

Download URL browsermem-0.1.0-py3-none-win_amd64.whl
Size 161.1 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
97ce84a4d56e18d13791a8153ccf73463478fb758e699682b8f466641442d39a
BLAKE2b-256 checksum
How to use checksums
45e89263d75c0de624241293df1d64f0a5ba88f71281d060b2cb03bd8b8f703b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for browsermem 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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for browsermem-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

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 Full 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