feat: add frameLocator support for cross-origin iframe interaction#460
Open
giulio-leone wants to merge 1 commit intovercel-labs:mainfrom
Open
feat: add frameLocator support for cross-origin iframe interaction#460giulio-leone wants to merge 1 commit intovercel-labs:mainfrom
giulio-leone wants to merge 1 commit intovercel-labs:mainfrom
Conversation
Add a new 'framelocator' action that uses Playwright's frameLocator() API to enable interaction with cross-origin iframes. The existing 'frame' command uses page.frame() which doesn't work across origins. Changes: - browser.ts: Add activeFrameLocator property, setFrameLocator() method, and modify getLocator() to scope through frameLocator when active - types.ts: Add FrameLocatorCommand interface - protocol.ts: Add framelocator schema - actions.ts: Add framelocator case and handler - commands.rs: Add 'frame locator <selector>' CLI parsing Closes vercel-labs#279
Contributor
|
@g97iulio1609 is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
This was referenced Feb 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a new
framelocatoraction that uses Playwright'sframeLocator()API to enable interaction with cross-origin iframes. The existingframecommand usespage.frame()/contentFrame()which doesn't work across origins due to browser security restrictions.Changes
src/browser.ts: AddactiveFrameLocatorproperty,setFrameLocator()method, and modifygetLocator()to scope throughframeLocator()when active. Also clear frame locator whenswitchToMainFrame()is called.src/types.ts: AddFrameLocatorCommandinterfacesrc/protocol.ts: Addframelocatorschema to validation and discriminated unionsrc/actions.ts: Addframelocatorcase in dispatch andhandleFrameLocatorhandlercli/src/commands.rs: Addframe locator <selector>CLI parsingUsage
How it works
Playwright's
frameLocator()is a lazy API that doesn't require the frame to be loaded at the time of the call and works with cross-origin iframes (unlikeframe()). When a frame locator is active,getLocator()scopes all element lookups throughpage.frameLocator(selector).locator(...).Closes #279