Frames from other sites
A frame of your own site is part of the page: the agent reads it and points into it with nothing to set up. A frame from another site is closed to the page around it, by the browser. It can take part when both sides agree: your page names the frame's site, and the frame's own site adds one line and names yours.
The three kinds of frame
| Frame | What the agent gets | What you do |
|---|---|---|
| Same site as the page | Read, point, and act with the caller's consent | Nothing |
| Another site, set up as below | Read and point. It cannot type or press there | The two steps below |
| Another site, without it | A labelled box: “Card payment”, nothing inside | Nothing. Give the frame a title so the box has a name |
1. On your page, name the frame's site
Add data-frames to the line you already have. Frames of any site you did not name are ignored, so an advert or a widget in a frame can never add anything to what the agent reads.
<script src="https://browsemcp-dashboard.haris-299.workers.dev/sdk.js" async
data-frames="https://pay.partner.example"></script>From your own code: BrowseMCP.mount({ apiUrl, frames: ["https://pay.partner.example"] }).
2. Inside the frame, add one line
On the page that is shown in the frame (not on the page around it), name the sites that may embed it. Several are separated by spaces.
<script src="https://browsemcp-dashboard.haris-299.workers.dev/sdk.js" async
data-embedded-in="https://www.your-shop.example"></script>From your own code, the same thing:
BrowseMCP.frame({
allowOrigins: ["https://www.your-shop.example"],
// Optional, on top of the built-in rules:
masking: { mask: [".order-total"], deny: [".ads"] },
});The framed page shows no button and asks the caller nothing: it follows the page around it. When the caller allows sharing there, the frame joins; when sharing pauses or stops, the frame stops and removes anything drawn in it.
What keeps this safe
- Both sides opt in. Your page listens only to frames of sites you named. The frame answers only the page directly around it, and only if that page's site is one it named. Exact addresses only: no wildcards, and
httpsonly. - The frame builds and masks its own tree, inside the frame, with the same rules as any page. Passwords and card fields are never sent, and what is typed is never read. Nothing the frame would not share on its own leaves it.
- The page checks every message field by field, takes at most 200 elements from a frame and at most 8 frames, and the service cleans the result again on arrival.
- The agent cannot type, press or follow links inside such a frame, even when the caller has allowed it to act on the page. A payment provider's frame that does not add the line stays a labelled box.
- If the framed page has a Content Security Policy, it needs the same two entries as any page: see Content Security Policy.
What the agent sees
Elements inside such a frame have ids that start with fr1-, fr2- and so on, and are never marked as something it can act on. highlight_element, annotate and scroll_to work on them: the frame draws the mark and the agent's cursor goes to the frame.