Several guides use broad headings and repeat their summaries, making the main example harder to follow. This change names each task directly, keeps Notion's clipboard investigation in the main reading path, and moves the Markdown example and longer provenance into expandable details. The browser guide now opens the hosted example, and the first native CLI query works without a global install. The existing figures, prompts, source excerpts and comparison controls remain the teaching material. Provider details now fit narrow screens. The repository README links to all Showcases, and the website authoring docs share a signed design principle: a good website is like a good paper—easy to follow, clear and concise, with a clean, refined presentation. A new style guide and scoped AGENTS.md explain how to maintain that approach. Closes #985. Validation: - `python3 scripts/prepare-website.py` and `python3 scripts/verify-website.py`: 12 HTML pages, 183 local references, SVG XML, the six-file ZIP and the sole manual Pages publisher. - Oxfmt checks and `git diff --check`; `npm run check:fast` with Node.js 24.18.0. - Browser checks at both `/` and `/rea/`: 24 routes, 68 copy buttons, 20 comparison steps, two CSV exports, two ZIP downloads and eight viewport widths from 320px to 1440px. - Existing code excerpts, expanded details, keyboard access, no-JavaScript content, continuous cursor animation and reduced motion checked. Existing analysis and compiler-check evidence is retained; real native-provider verification and compiler replay were not rerun for these copy and layout changes. The homepage content and publication triggers are unchanged.
339 lines
14 KiB
HTML
339 lines
14 KiB
HTML
<!doctype html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
<title>Browser observation — REA</title>
|
||
<meta
|
||
name="description"
|
||
content="Observe a Notes export with REA: select a browser page, capture a click, inspect the request and follow the export script."
|
||
/>
|
||
<meta name="theme-color" content="#ffffff" />
|
||
<link rel="icon" href="../../assets/favicon.svg" type="image/svg+xml" />
|
||
<link rel="stylesheet" href="../../assets/styles.css" />
|
||
<script src="../../assets/main.js" defer></script>
|
||
</head>
|
||
<body>
|
||
<a class="skip-link" href="#main">Skip to content</a>
|
||
<header class="site-header">
|
||
<div class="container header-inner">
|
||
<a class="brand" href="../../" aria-label="REA home"
|
||
><span class="brand-name">REA</span
|
||
><span class="brand-caption">Reverse Engineer Anything</span></a
|
||
>
|
||
<nav class="navigation" aria-label="Main navigation">
|
||
<a href="../../showcase/">Showcases</a
|
||
><a class="nav-start" href="../../get-started/">Get started</a
|
||
><a href="../">Guides</a
|
||
><a href="https://github.com/morluto/rea">GitHub</a>
|
||
</nav>
|
||
</div>
|
||
</header>
|
||
<main id="main" class="container">
|
||
<div class="page-heading">
|
||
<p class="breadcrumb">
|
||
<a href="../../">Home</a> / <a href="../">Guides</a> / Browser
|
||
observation
|
||
</p>
|
||
<h1>See what happens<br />when you click.</h1>
|
||
<p class="lede">
|
||
Use a small browser app to connect an action, its network request and
|
||
the JavaScript that builds a download.
|
||
</p>
|
||
</div>
|
||
<div class="article-layout">
|
||
<nav class="contents" aria-label="On this page">
|
||
<p>In this guide</p>
|
||
<ul>
|
||
<li><a href="#example">The example</a></li>
|
||
<li><a href="#prepare">Open the browser</a></li>
|
||
<li><a href="#ask">Ask your agent</a></li>
|
||
<li><a href="#capture">Capture from CLI</a></li>
|
||
<li><a href="#result">Read the request and script</a></li>
|
||
</ul>
|
||
</nav>
|
||
<article class="article" aria-label="Browser observation">
|
||
<section class="article-section" id="example">
|
||
<h2>What happens when you click Export?</h2>
|
||
<p>
|
||
The
|
||
<a href="../../examples/notes-web/">Notes browser example</a> has
|
||
an <strong>Export notes</strong> button. Clicking it loads
|
||
<code>notes.json</code>, formats the two notes as CSV, and starts
|
||
a download.
|
||
</p>
|
||
<figure class="workflow-figure">
|
||
<p class="figure-title">From the click to the CSV download</p>
|
||
<ol class="flow-steps">
|
||
<li>
|
||
<span class="flow-label">01 · You</span
|
||
><span class="flow-node">Click Export notes</span
|
||
><span class="flow-note"
|
||
>Perform the action in your browser while the capture is
|
||
running.</span
|
||
>
|
||
</li>
|
||
<li>
|
||
<span class="flow-label">02 · REA</span
|
||
><span class="flow-node">Record the request</span
|
||
><span class="flow-note"
|
||
>Capture the request URL, response status and JSON structure
|
||
from the selected page.</span
|
||
>
|
||
</li>
|
||
<li>
|
||
<span class="flow-label">03 · Your agent</span
|
||
><span class="flow-node">Read the export code</span
|
||
><span class="flow-note"
|
||
>Connect the observed request to
|
||
<code>fetch("./notes.json")</code> in
|
||
<code>export.js</code>.</span
|
||
>
|
||
</li>
|
||
</ol>
|
||
<p class="flow-result">
|
||
<code>GET notes.json → 200 → notes[] → CSV</code>
|
||
</p>
|
||
<figcaption>
|
||
Start the capture before clicking Export notes.
|
||
</figcaption>
|
||
</figure>
|
||
</section>
|
||
<section class="article-section" id="prepare">
|
||
<h2>Open Chrome with remote debugging</h2>
|
||
<p>
|
||
Open the hosted Notes example with a separate browser profile and
|
||
a local debugging port. On Linux:
|
||
</p>
|
||
<div class="code-block">
|
||
<div class="code-header">
|
||
<span>Start the example browser</span
|
||
><button
|
||
class="copy-button"
|
||
type="button"
|
||
data-copy="browser-start"
|
||
aria-label="Copy start the example browser"
|
||
>
|
||
Copy
|
||
</button>
|
||
</div>
|
||
<pre><code id="browser-start">google-chrome \
|
||
--remote-debugging-port=9222 \
|
||
--user-data-dir=/tmp/rea-notes-browser \
|
||
https://morluto.github.io/rea/examples/notes-web/</code></pre>
|
||
</div>
|
||
<p>
|
||
Use your installed browser's executable path on macOS or Windows.
|
||
You can replace the page URL with another page you want to
|
||
inspect.
|
||
</p>
|
||
<p>
|
||
REA connects to this existing browser. You keep control of the
|
||
page, perform the action, and close the browser when finished.
|
||
</p>
|
||
</section>
|
||
<section class="article-section" id="ask">
|
||
<h2>Ask your agent to watch one action</h2>
|
||
<div class="agent-terminal">
|
||
<div class="terminal-header">
|
||
<span class="terminal-title"
|
||
><span class="terminal-dots" aria-hidden="true"
|
||
><i></i><i></i><i></i></span
|
||
>Your coding agent</span
|
||
><button
|
||
class="copy-button"
|
||
type="button"
|
||
data-copy="browser-prompt"
|
||
aria-label="Copy example prompt"
|
||
>
|
||
Copy
|
||
</button>
|
||
</div>
|
||
<p class="terminal-prompt">
|
||
<span class="prompt-symbol" aria-hidden="true">›</span
|
||
><span id="browser-prompt"
|
||
>Use REA to inspect this page while I click Export notes. What
|
||
request does it make, and how is the CSV built?</span
|
||
><span class="terminal-cursor" aria-hidden="true"></span>
|
||
</p>
|
||
</div>
|
||
<p class="caption">
|
||
Example prompt. Give your agent the debugging endpoint,
|
||
<code>http://127.0.0.1:9222</code>, and the page URL. Let it start
|
||
the capture before you click.
|
||
</p>
|
||
<p>
|
||
Your agent discovers the page target, starts an observation
|
||
window, and reads the resulting evidence. It can then inspect the
|
||
script behind the export.
|
||
</p>
|
||
</section>
|
||
<section class="article-section" id="capture">
|
||
<h2>Or capture from the terminal</h2>
|
||
<p>Find the page's target ID:</p>
|
||
<div class="code-block">
|
||
<div class="code-header">
|
||
<span>Find the page</span
|
||
><button
|
||
class="copy-button"
|
||
type="button"
|
||
data-copy="browser-targets"
|
||
aria-label="Copy find the page"
|
||
>
|
||
Copy
|
||
</button>
|
||
</div>
|
||
<pre><code id="browser-targets">npx -y rea-agents@latest list-browser-targets \
|
||
http://127.0.0.1:9222 --json</code></pre>
|
||
</div>
|
||
<p>
|
||
Choose the target with the Notes example URL. Replace
|
||
<code>TARGET_ID</code> below with its ID, then run:
|
||
</p>
|
||
<div class="code-block">
|
||
<div class="code-header">
|
||
<span>Capture the next ten seconds</span
|
||
><button
|
||
class="copy-button"
|
||
type="button"
|
||
data-copy="browser-capture"
|
||
aria-label="Copy capture the next ten seconds"
|
||
>
|
||
Copy
|
||
</button>
|
||
</div>
|
||
<pre><code id="browser-capture">npx -y rea-agents@latest inspect-web-page \
|
||
http://127.0.0.1:9222 TARGET_ID \
|
||
--observation-ms 10000 \
|
||
--include-accessibility-text \
|
||
--include-json-body-shapes --json</code></pre>
|
||
</div>
|
||
<p>
|
||
Let the command connect for a few seconds, then click
|
||
<strong>Export notes</strong> in that browser. The result arrives
|
||
after the observation window ends.
|
||
</p>
|
||
<p>
|
||
The captured result includes the selected page, network activity
|
||
during that window, and the shape of the JSON response. Earlier
|
||
requests are outside this capture.
|
||
</p>
|
||
</section>
|
||
<section class="article-section" id="result">
|
||
<h2>Read the request and export script</h2>
|
||
<div class="evidence-table-wrap">
|
||
<table class="evidence-table">
|
||
<caption>
|
||
Recorded with REA 4.1.0 on the local Notes example
|
||
</caption>
|
||
<thead>
|
||
<tr>
|
||
<th>Captured fact</th>
|
||
<th>Value</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>Request</td>
|
||
<td><code>GET /examples/notes-web/notes.json</code></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Response</td>
|
||
<td><code>200 · application/json</code></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Request initiator</td>
|
||
<td><code>export.js</code> · script</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Response structure</td>
|
||
<td>
|
||
<code>notes[]</code> with <code>id</code> and
|
||
<code>title</code> fields
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<p class="caption">
|
||
The hosted example's request path includes the site's
|
||
<code>/rea/</code> prefix.
|
||
</p>
|
||
<div class="code-block">
|
||
<div class="code-header">
|
||
<span>Read the loaded scripts</span
|
||
><button
|
||
class="copy-button"
|
||
type="button"
|
||
data-copy="browser-scripts"
|
||
aria-label="Copy read the loaded scripts"
|
||
>
|
||
Copy
|
||
</button>
|
||
</div>
|
||
<pre><code id="browser-scripts">npx -y rea-agents@latest inspect-web-page \
|
||
http://127.0.0.1:9222 TARGET_ID \
|
||
--include-script-sources --json</code></pre>
|
||
</div>
|
||
<p>
|
||
The request identifies the data source, and REA records
|
||
<code>export.js</code> as its initiator. Read the captured script
|
||
source to see how the data is used:
|
||
</p>
|
||
<div class="code-block">
|
||
<div class="code-header">
|
||
<span>export.js · example source excerpt</span>
|
||
</div>
|
||
<pre><code>const response = await fetch("./notes.json");
|
||
const { notes } = await response.json();
|
||
// Format each note as a CSV row.
|
||
const url = URL.createObjectURL(new Blob([csv], { type: "text/csv" }));
|
||
link.href = url;
|
||
link.download = "notes.csv";
|
||
link.click();</code></pre>
|
||
</div>
|
||
<p>
|
||
The download is constructed in the page using the JSON response.
|
||
The CSV formatting step comes from the script; the network capture
|
||
establishes that this click requested <code>notes.json</code>.
|
||
</p>
|
||
<p>
|
||
<a href="../../examples/notes-web/">Open the example</a> ·
|
||
<a href="../../examples/notes-web/export.js" download
|
||
>Download export.js</a
|
||
>
|
||
·
|
||
<a href="../../examples/notes-web/notes.json" download
|
||
>Download notes.json</a
|
||
>
|
||
</p>
|
||
<blockquote class="prompt">
|
||
<p>
|
||
Find the script that requests <code>notes.json</code>. How does
|
||
it escape titles containing commas or quotation marks?
|
||
</p>
|
||
</blockquote>
|
||
<p>
|
||
For an installed JavaScript or Electron app, continue with the
|
||
<a href="../javascript/">application workflow</a> to follow files
|
||
and process boundaries.
|
||
</p>
|
||
</section>
|
||
</article>
|
||
</div>
|
||
</main>
|
||
<footer class="site-footer">
|
||
<div class="container footer-inner">
|
||
<p>REA · Reverse Engineer Anything</p>
|
||
<div class="footer-links">
|
||
<a href="https://github.com/morluto/rea">Source</a
|
||
><a href="https://github.com/morluto/rea/blob/main/LICENSE"
|
||
>MIT license</a
|
||
><a href="https://discord.gg/GkcryMnJDM">Community</a>
|
||
</div>
|
||
</div>
|
||
</footer>
|
||
<p class="sr-only" id="copy-status" role="status" aria-live="polite"></p>
|
||
</body>
|
||
</html>
|