[GH-ISSUE #1496] fix(browser): keep the first DOM attribute when the name is repeated #517

Closed
opened 2026-10-15 18:25:47 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @cursor[bot] on GitHub (Oct 10, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/1496

TL;DR: Page capture lists every DOM attribute name, then keeps only the last value when the name repeats. URL and policy hints are taken from that last value.

Area

Browser page capture

Observed behavior

In src/browser/CdpCaptureDocuments.ts, each node records attribute_names from every name in the CDP attribute list, including duplicates.

domMetadata folds the same list into a Map with pairs.set(name.toLowerCase(), value). A second href, action, or src replaces the first. dom_urls and agent hints then read only the surviving value. Nothing on the node says another value was dropped.

HTML uses the first declaration when an attribute name is repeated. The observation can show two href names and a destination computed from the second.

Expected behavior

Repeated attribute names should keep the first value, matching HTML, or the node should carry each value and say the destination was chosen from one of them. attribute_names and the URL list should describe the same attributes.

Where

  • src/browser/CdpCaptureDocuments.ts — node attribute_names, domMetadata
Originally created by @cursor[bot] on GitHub (Oct 10, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/1496 **TL;DR:** Page capture lists every DOM attribute name, then keeps only the last value when the name repeats. URL and policy hints are taken from that last value. ### Area Browser page capture ### Observed behavior In `src/browser/CdpCaptureDocuments.ts`, each node records `attribute_names` from every name in the CDP attribute list, including duplicates. `domMetadata` folds the same list into a `Map` with `pairs.set(name.toLowerCase(), value)`. A second `href`, `action`, or `src` replaces the first. `dom_urls` and agent hints then read only the surviving value. Nothing on the node says another value was dropped. HTML uses the first declaration when an attribute name is repeated. The observation can show two `href` names and a destination computed from the second. ### Expected behavior Repeated attribute names should keep the first value, matching HTML, or the node should carry each value and say the destination was chosen from one of them. `attribute_names` and the URL list should describe the same attributes. ### Where - `src/browser/CdpCaptureDocuments.ts` — node `attribute_names`, `domMetadata`
bsakaguchi 2026-10-15 18:25:47 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#517
No description provided.