feat(firefox): support ElementHandle.contentFrame() (#3917)
This commit is contained in:
parent
dd8bd6dcb1
commit
28087c291f
@ -780,6 +780,19 @@ function getScreenshotMimeType(options) {
|
||||
}
|
||||
|
||||
class ElementHandle extends JSHandle {
|
||||
/**
|
||||
* @return {?Frame}
|
||||
*/
|
||||
async contentFrame() {
|
||||
const {frameId} = await this._session.send('Page.contentFrame', {
|
||||
frameId: this._frameId,
|
||||
objectId: this._objectId,
|
||||
});
|
||||
if (!frameId)
|
||||
return null;
|
||||
const frame = this._frame._page._frames.get(frameId);
|
||||
return frame;
|
||||
}
|
||||
|
||||
/**
|
||||
* @override
|
||||
|
@ -8,7 +8,7 @@
|
||||
"node": ">=8.9.4"
|
||||
},
|
||||
"puppeteer": {
|
||||
"firefox_revision": "ca4758c475a9c05dc88b7b8811fbbb7e5acf95b4"
|
||||
"firefox_revision": "d026cf7a14cb7dbe65acc4a4188c570da10a501c"
|
||||
},
|
||||
"scripts": {
|
||||
"install": "node install.js",
|
||||
|
@ -132,7 +132,7 @@ module.exports.addTests = function({testRunner, expect}) {
|
||||
describe('ElementHandle.contentFrame', function() {
|
||||
it('should work', async({page,server}) => {
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
await utils.attachFrame(page, 'frame1', server.EMPTY_PAGE);
|
||||
await utils.attachFrame(page, 'frame1', server.EMPTY_PAGE2);
|
||||
const elementHandle = await page.$('#frame1');
|
||||
const frame = await elementHandle.contentFrame();
|
||||
expect(frame).toBe(page.frames()[1]);
|
||||
|
Loading…
Reference in New Issue
Block a user