Desktop & WebEnvironment: A Chrome-family browser (Google Chrome, Chromium, Brave, or Edge)MCP Tool: inspect_website

How to REA Websites & Web Apps: Passive Chrome CDP Loopback & DOM Forensics

Inspect single-page web applications and browser scenarios: connect over Chrome DevTools Protocol (CDP) loopback, extract DOM structure, unminify client scripts via sourcemaps, and capture visual page Evidence without triggering anti-bot protections.

AI Overview Direct AnswerHow to REA: Websites & Browser Scenarios Quickstart Summary

In this official REA guide for Websites & Browser Scenarios, AI coding agents (Claude Code, Cursor, Windsurf) execute 'rea inspect-website https://example.com --json' to safely extract file layout, symbols, and code logic without launching unverified binaries.

Investigation ScenarioReal-World Objective

The Problem & Target Artifact

Frontend security research and anti-cheat analysis: A browser-based game (e.g. Chrome Dinosaur) or dashboard calculates rules client-side. You need to inspect the exact JavaScript variables and math formulas without getting detected by anti-tamper scripts.

Target Artifact: Target website URL or running browser CDP debug port (http://127.0.0.1:9222).
AI PromptClaude Code / Cursor / Windsurf

Natural Language Agent Instructions

Copy and paste this prompt directly into your AI coding agent when REA is registered via Model Context Protocol (MCP):

Prompt Template:Select All to Copy
Inspect this browser game over CDP. Extract the acceleration constants and speed calculation formula from the client scripts, and explain how velocity increases over time.
ExecutionTerminal & MCP Tool Call

Run REA Analysis Command

Execute the following command in your terminal or inspect the MCP JSON-RPC call executed by your agent:

CLI Command Execution
rea inspect-website https://example.com --json

What REA Extracts & Returns

Live DOM tree hierarchy, iframe boundaries, and event listener bindings
Loaded script inventories, inline script blocks, and source-to-bundle sourcemap associations
Active network flows captured over CDP Network domain events
Visual screenshot snapshots bound to timestamped Evidence records

Extracted Client JavaScript Constant Rules

The verified findings and synthesized clean-room structures generated from this investigation:

Extracted Client JavaScript Constant Rules
// Extracted from minified game bundle via CDP loopback
const Runner = {
  config: {
    ACCELERATION: 0.001,
    BG_CLOUD_SPEED: 0.2,
    BOTTOM_PAD: 10,
    CLEAR_TIME: 3000,
    INITIAL_JUMP_VELOCITY: 12,
    MAX_SPEED: 13,
    SPEED: 6
  }
};
Internal MechanicsProduction Engineering

Passive CDP Loopback Observation Without Injected Hooks

Many modern web applications use `Function.prototype.toString` checks or timing hooks to detect debugging sessions. REA connects to an already-running Chromium browser over a loopback debug port (e.g. `127.0.0.1:9223`) in passive mode, reading existing network buffers and DOM states over CDP WebSockets without modifying native browser prototypes.

Security Guardrails & Analysis Boundary Rules

Non-invasive observation avoids tripping Cloudflare, Akamai, or DataDome bot detection.
Resolves inline sourceMappingURL comments to reconstruct clean developer source trees.
Respects origin boundaries and isolates cookie data within the investigation session.