mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
175963182e
This patch implements FrameManager which is responsible for maintaining the frame tree. FrameManager is quite basic: it sends FrameAttached, FrameDetached and FrameNavigated events, and can report mainFrame and all frames. The next step would be moving certain Page API's to the Frame. For example, such method as Page.evaluate, Page.navigate and others should be available on Frame object as well. References #4
23 lines
443 B
HTML
23 lines
443 B
HTML
<style>
|
|
body {
|
|
display: flex;
|
|
}
|
|
|
|
body iframe {
|
|
flex-grow: 1;
|
|
flex-shrink: 1;
|
|
}
|
|
</style>
|
|
<script>
|
|
async function attachFrame(frameId, url) {
|
|
var frame = document.createElement('iframe');
|
|
frame.src = url;
|
|
frame.id = frameId;
|
|
document.body.appendChild(frame);
|
|
await new Promise(x => frame.onload = x);
|
|
return 'kazakh';
|
|
}
|
|
</script>
|
|
<iframe src='./two-frames.html'></iframe>
|
|
<iframe src='./frame.html'></iframe>
|