Files
playwriter/docs/framer-iframe-snapshot-guide.md
Tommy D. Rossi 87188423b1 feat: reuse Playwright's internal CDP session instead of creating new WebSocket connections
Switch from getCDPSessionForPage (creates a new WS via Target.attachToTarget)
to getExistingCDPSessionForPage which reuses Playwright's internal CRSession.
This is critical for the relay server where Target.attachToTarget is intercepted
and cannot create real new sessions.

Also add FrameLocator support in accessibilitySnapshot — FrameLocator (from
locator.contentFrame()) is now auto-resolved to the real Frame object needed
for OOPIF CDP session attachment.

- New PlaywrightCDPSessionAdapter wrapping Playwright's CDPSession as ICDPSession
- New getExistingCDPSessionForPage() using context.getExistingCDPSession()
- resolveFrame() helper converts FrameLocator to Frame via elementHandle().contentFrame()
- getAriaSnapshot() frame param now accepts Frame | FrameLocator
- Executor CDP cache uses ICDPSession, borrowed sessions detach as no-op
- Test for getExistingCDPSession through the relay
- Updated framer iframe guide with alternative page.frames() example
- Bump playwright submodule to @xmorse/playwright-core@1.59.2
- Fix styles-api.md import path
2026-02-06 18:03:26 +01:00

3.0 KiB
Raw Blame History

title, description, prompt
title description prompt
Framer Plugin Iframe Snapshot Guide Step-by-step instructions to open the Framer MCP plugin iframe and run accessibilitySnapshot on it. Create a concise step-by-step guide to open the Framer plugin iframe and verify accessibilitySnapshot on that iframe using playwriter CLI. Include the exact Framer project URL and the plugins.framercdn iframe URL. Also document the Command+K workflow to open the MCP plugin: press Command+K, search for MCP in the command palette, press Enter, then wait ~1 second for the iframe to appear. Reference any files read for context. Sources: - @/Users/morse/Documents/GitHub/playwriter/tmp/session-ses_437d9a10bffeFmy3k3hVcAFZnf.md - @/Users/morse/Documents/GitHub/playwriter/tmp/session-ses_43807a563ffe1tCS0FWK79IpcV.md

Step-by-step

playwriter -s 1 -e "console.log(await accessibilitySnapshot({ page, search: /dialog|Search…|MCP/ }));"
  • Search for MCP, press Enter, then wait about 1 second for the plugin iframe to appear.

  • Verify the plugin iframe exists (should include plugins.framercdn.com):

playwriter -s 1 -e "const iframes = await page.locator('iframe').all(); for (const f of iframes) { console.log(await f.getAttribute('src')); }"
  • Wait until the MCP iframe is present (verifies the action worked):
playwriter -s 1 -e "const iframe = page.locator(\"iframe[src*='plugins.framercdn.com']\"); await iframe.first().waitFor({ timeout: 10000 }); console.log('iframe ready');"
  • Grab the iframes locator by URL:
playwriter -s 1 -e "const iframe = page.locator(\"iframe[src*='plugins.framercdn.com']\"); console.log(await iframe.count());"
  • Run the accessibility snapshot on that iframe using contentFrame() (FrameLocator is auto-resolved to Frame):
playwriter -s 1 -e "const frame = await page.locator(\"iframe[src*='plugins.framercdn.com']\").contentFrame(); console.log(await accessibilitySnapshot({ page, frame }));"
  • Alternative: use page.frames() to get the Frame directly:
playwriter -s 1 -e "const frame = page.frames().find(f => f.url().includes('plugins.framercdn.com')); console.log(await accessibilitySnapshot({ page, frame }));"
  • Validate the snapshot contains MCP UI text (confirms the panel is actually loaded):
playwriter -s 1 -e "const frame = await page.locator(\"iframe[src*='plugins.framercdn.com']\").contentFrame(); console.log(await accessibilitySnapshot({ page, frame, search: /Control Framer with MCP|Login With Google/ }));"

Expected iframe URL