SightlineDocs
Sign in

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

FrameWhat the agent getsWhat you do
Same site as the pageRead, point, and act with the caller's consentNothing
Another site, set up as belowRead and point. It cannot type or press thereThe two steps below
Another site, without itA labelled box: “Card payment”, nothing insideNothing. 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.

HTML, on your page
<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.

HTML, in the framed page
<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:

JavaScript, in the framed page
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

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.