Skip to content

Add Chromium plugin for Chrome/Edge DOM inspection#6

Merged
asklar merged 2 commits into
mainfrom
chromium-plugin
Feb 26, 2026
Merged

Add Chromium plugin for Chrome/Edge DOM inspection#6
asklar merged 2 commits into
mainfrom
chromium-plugin

Conversation

@asklar
Copy link
Copy Markdown
Owner

@asklar asklar commented Feb 26, 2026

Summary

Adds a browser extension + native messaging host architecture that lets lvt dump the DOM tree from Chrome and Edge tabs.

Components

  • Browser extension (Manifest V3) — uses chrome.debugger API (CDP) to walk the DOM tree, including shadow DOM. Works on both Chrome and Edge.
  • Native messaging host (lvt_chromium_host.exe) — relays between Chrome's stdin/stdout native messaging protocol and a Win32 named pipe
  • Plugin DLL (lvt_chromium_plugin.dll) — standard 4-export lvt plugin that detects chrome.exe/msedge.exe and connects to the pipe to request DOM trees
  • Deterministic extension ID via fixed key field in manifest — no hardcoded IDs that change per install

Data flow

lvt.exe → plugin DLL → named pipe → host.exe → stdin/stdout → extension → chrome.debugger (CDP) → DOM

No --remote-debugging-port flag required.

One-time setup

  1. lvt_chromium_host.exe --register (creates registry entries for Chrome + Edge)
  2. Load the extension in Chrome/Edge via chrome://extensions → Load unpacked

Files

File Purpose
src/plugin_chromium/lvt_chromium_plugin.cpp Plugin DLL
src/plugin_chromium/chromium_host.cpp Native messaging host relay
src/plugin_chromium/extension/ Browser extension (manifest + service worker)
docs/chromium-plugin.md Documentation
tests/chromium_tests.cpp Unit tests (11 tests)

Pipeline changes

  • CI and release pipelines now run lvt_chromium_tests.exe
  • Plugins already bundle in the release zip (no changes needed)
  • SKILL.md updated with Chromium framework + setup instructions

Tested

Verified end-to-end with Edge Stable on example.com — full DOM tree with tags, text, attributes, and bounding boxes.

asklar and others added 2 commits February 26, 2026 13:43
Adds a browser extension + native messaging host architecture that lets lvt
dump the DOM tree from Chrome and Edge tabs:

- Browser extension (Manifest V3) uses chrome.debugger API (CDP) to walk the
  DOM tree, including shadow DOM and iframes
- Native messaging host (lvt_chromium_host.exe) relays between Chrome's
  stdin/stdout protocol and a Win32 named pipe
- Plugin DLL (lvt_chromium_plugin.dll) detects chrome.exe/msedge.exe and
  connects to the named pipe to request and receive the DOM tree
- Extension uses a fixed key for deterministic extension ID across installs
- Filters out non-debuggable tabs (chrome://, edge://, about: URLs)

No --remote-debugging-port flag required.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Run lvt_chromium_tests.exe in both CI and release pipelines
- Add chromium to framework list in SKILL.md
- Document one-time Chrome/Edge extension setup for DOM inspection

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@asklar asklar merged commit 25e3ef9 into main Feb 26, 2026
1 check passed
@asklar asklar deleted the chromium-plugin branch February 26, 2026 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant