mirror of
https://github.com/microsoft/playwright-mcp.git
synced 2025-07-27 09:02:26 +08:00
chore: follow up with iframe stitch (#110)
This commit is contained in:
parent
0a5518b252
commit
0de7c0d38c
@ -188,8 +188,12 @@ export class Context {
|
|||||||
if (value.startsWith('iframe ')) {
|
if (value.startsWith('iframe ')) {
|
||||||
const ref = value.match(/\[ref=(.*)\]/)?.[1];
|
const ref = value.match(/\[ref=(.*)\]/)?.[1];
|
||||||
if (ref) {
|
if (ref) {
|
||||||
|
try {
|
||||||
const childSnapshot = await this._allFramesSnapshot(frame.frameLocator(`aria-ref=${ref}`));
|
const childSnapshot = await this._allFramesSnapshot(frame.frameLocator(`aria-ref=${ref}`));
|
||||||
return snapshot.createPair(node.value, childSnapshot);
|
return snapshot.createPair(node.value, childSnapshot);
|
||||||
|
} catch (error) {
|
||||||
|
return snapshot.createPair(node.value, '<could not take iframe snapshot>');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -347,7 +347,7 @@ test('save as pdf', async ({ client }) => {
|
|||||||
- Page Title: Title
|
- Page Title: Title
|
||||||
- Page Snapshot
|
- Page Snapshot
|
||||||
\`\`\`yaml
|
\`\`\`yaml
|
||||||
- document [ref=s1e2]: Hello, world!
|
- text: Hello, world!
|
||||||
\`\`\`
|
\`\`\`
|
||||||
`
|
`
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user