The Electron guide currently uses a teaching fixture. Add a real Notion clipboard case with REA findings, short source excerpts and responsive figures, alongside the existing DX-Ball reconstruction. - Trace the saved Notion 7.6.1 preload API through its wrappers to the clipboard receiver. Attribute the separate web-cache module probes to their original harness. Public content uses relative source locations and generic example data; packages and complete captures stay local. - Add a Showcases index and links from the homepage and JavaScript guide. Simplify homepage copy while preserving the approved headline and closing question. - Show copyable agent installation prompts and the direct setup command. Keep terminal cursors blinking consistently and respect reduced-motion settings. - Provide one Notes example ZIP. Generate it from the six public source files before website checks and manual Pages deployment; verify its contents against the source. Pages remains manual-only. Validation: - `npm run check:fast` - `python3 scripts/prepare-website.py` and `python3 scripts/verify-website.py` - Browser checks at `/` and `/rea/`: downloads, prompt/command copying, responsive layouts, keyboard navigation, reduced motion and DX-Ball comparison controls. - Published REA 4.1.0 preload analysis and feature traces; source/claim/privacy review. - Real Hopper/Ghidra verification: not performed (website-only change).
340 lines
14 KiB
HTML
340 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 and follow</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>
|
||
<p>
|
||
We want to see which request the click makes, then use the script
|
||
to understand how the response becomes a file.
|
||
</p>
|
||
<figure class="workflow-figure">
|
||
<p class="figure-title">One action, captured while it happens</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>
|
||
The request and response metadata come from the capture. CSV
|
||
construction is explained by reading the script.
|
||
</figcaption>
|
||
</figure>
|
||
</section>
|
||
<section class="article-section" id="prepare">
|
||
<h2>Open an observable browser</h2>
|
||
<p>
|
||
Start a Chrome-family browser with a dedicated profile and a local
|
||
debugging port. On Linux, for this site's local preview:
|
||
</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 \
|
||
http://127.0.0.1:4173/examples/notes-web/</code></pre>
|
||
</div>
|
||
<p>
|
||
Use your installed browser's executable path on macOS or Windows.
|
||
The page URL should point to your local preview or
|
||
<a href="../../examples/notes-web/">the hosted Notes example</a>.
|
||
</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 result, then follow the code</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>
|
||
<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>
|