# longvh211/chromium-automation-with-cdp-for-vba architecture

> Architecture diagram of the GitHub repository longvh211/chromium-automation-with-cdp-for-vba, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/longvh211/chromium-automation-with-cdp-for-vba
- Repository: https://github.com/longvh211/chromium-automation-with-cdp-for-vba

## Overview

This VBA framework automates Chromium-based browsers through the Chrome DevTools Protocol. The principal workflow is to create a browser session, manage tabs, then inspect and interact with page elements or extract page content. The README also documents browser/window configuration, JavaScript-library integration, snapshots, and session reattachment. Source excerpts were not provided, so components and links below rely on README descriptions; internal call ownership and lower-level protocol details cannot be verified.

Main entry points: [`Class Modules/CDPBrowser.cls`](https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPBrowser.cls) (Browser control), [`Modules/init.bas`](https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Modules/init.bas) (Browser creation), [`Modules/demo.bas`](https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Modules/demo.bas) (Usage examples), [`Class Modules/CDPElement.cls`](https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPElement.cls) (Element interaction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["VBA entry"]
  node_init["Browser creation<br/>[init.bas]"]
  node_demo["Usage examples<br/>[demo.bas]"]
end

subgraph group_browser["Browser sessions"]
  node_browser_api["Browser control<br/>[CDPBrowser.cls]"]
  node_core["CDP protocol core<br/>[CDPCore.cls]"]
  node_session["Tab sessions<br/>[CDPBrowser.cls]"]
  node_window["Window control<br/>[CDPBrowser.cls]"]
  node_conversion["JSON conversion<br/>[CDPJConv.cls]"]
end

subgraph group_page["Page automation"]
  node_element["Element interaction<br/>[CDPElement.cls]"]
  node_selectors["Element lookup<br/>[CDPElement.cls]"]
  node_frames["Frame access<br/>[CDPElement.cls]"]
  node_page_content["Page content<br/>[CDPBrowser.cls]"]
  node_waits["Element waits<br/>[CDPElement.cls]"]
end

subgraph group_extensions["Page extensions"]
  node_js_library["JavaScript library<br/>[CDPBrowser.cls]"]
  node_snapshot["Page snapshots<br/>[CDPBrowser.cls]"]
end

node_developer(("VBA application"))
node_chromium["Chromium browser"]
node_external_js["External JS library"]

node_developer -->|"creates browser"| node_init
node_init -->|"returns object"| node_browser_api
node_browser_api -->|"starts browser"| node_chromium
node_browser_api -->|"manages tabs"| node_session
node_browser_api -->|"controls window"| node_window
node_browser_api -->|"extracts HTML"| node_page_content
node_browser_api -->|"adds library"| node_js_library
node_js_library -.->|"integrates"| node_external_js
node_js_library -->|"enables snapshots"| node_snapshot
node_developer -->|"interacts with"| node_element
node_developer -->|"finds elements"| node_selectors
node_developer -->|"accesses frames"| node_frames
node_developer -->|"waits for state"| node_waits
node_developer -->|"reviews examples"| node_demo

click node_init "https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Modules/init.bas"
click node_demo "https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Modules/demo.bas"
click node_browser_api "https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPBrowser.cls"
click node_core "https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPCore.cls"
click node_session "https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPBrowser.cls"
click node_window "https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPBrowser.cls"
click node_element "https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPElement.cls"
click node_selectors "https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPElement.cls"
click node_frames "https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPElement.cls"
click node_page_content "https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPBrowser.cls"
click node_waits "https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPElement.cls"
click node_conversion "https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPJConv.cls"
click node_js_library "https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPBrowser.cls"
click node_snapshot "https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPBrowser.cls"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_init,node_demo,node_chromium toneBlue
class node_browser_api,node_core,node_session,node_window,node_conversion toneAmber
class node_element,node_selectors,node_frames,node_page_content,node_waits toneMint
class node_js_library,node_snapshot toneRose
class node_developer,node_external_js toneIndigo
```

## Components

### VBA entry

- [Browser creation](https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Modules/init.bas): `Modules/init.bas`
- [Usage examples](https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Modules/demo.bas): `Modules/demo.bas`

### Browser sessions

- [Browser control](https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPBrowser.cls): `Class Modules/CDPBrowser.cls`
- [CDP protocol core](https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPCore.cls): `Class Modules/CDPCore.cls`
- [Tab sessions](https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPBrowser.cls): `Class Modules/CDPBrowser.cls`
- [Window control](https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPBrowser.cls): `Class Modules/CDPBrowser.cls`
- [JSON conversion](https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPJConv.cls): `Class Modules/CDPJConv.cls`

### Page automation

- [Element interaction](https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPElement.cls): `Class Modules/CDPElement.cls`
- [Element lookup](https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPElement.cls): `Class Modules/CDPElement.cls`
- [Frame access](https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPElement.cls): `Class Modules/CDPElement.cls`
- [Page content](https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPBrowser.cls): `Class Modules/CDPBrowser.cls`
- [Element waits](https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPElement.cls): `Class Modules/CDPElement.cls`

### Page extensions

- [JavaScript library](https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPBrowser.cls): `Class Modules/CDPBrowser.cls`
- [Page snapshots](https://github.com/longvh211/chromium-automation-with-cdp-for-vba/blob/main/Class%20Modules/CDPBrowser.cls): `Class Modules/CDPBrowser.cls`

### Other components

- **VBA application**
- **Chromium browser**
- **External JS library**

## Connections

- VBA application → Browser creation: creates browser (evidence: `README.md`)
- Browser creation → Browser control: returns object (evidence: `README.md`)
- Browser control → Chromium browser: starts browser (evidence: `README.md`)
- Browser control → Tab sessions: manages tabs (evidence: `README.md`)
- Browser control → Window control: controls window (evidence: `README.md`)
- Browser control → Page content: extracts HTML (evidence: `README.md`)
- Browser control → JavaScript library: adds library (evidence: `README.md`)
- JavaScript library → External JS library: integrates (evidence: `README.md`)
- JavaScript library → Page snapshots: enables snapshots (evidence: `README.md`)
- VBA application → Element interaction: interacts with (evidence: `README.md`)
- VBA application → Element lookup: finds elements (evidence: `README.md`)
- VBA application → Frame access: accesses frames (evidence: `README.md`)
- VBA application → Element waits: waits for state (evidence: `README.md`)
- VBA application → Usage examples: reviews examples (evidence: `README.md`)
