Skip to content

Request: browser.currentPage() or similar way to access Pages #443

@karelrochelt

Description

@karelrochelt

I was playing around with Puppeteer today and I found out that there is no way (that I know of) to run script like this:

const puppeteer = require('puppeteer');

puppeteer.connect({browserWSEndpoint: <endpoint>}).then(async browser => {
  const page = await browser.currentPage();
  // other actions that would manipulate the current page
  browser.close();
});

The only way to get a Page instance seems to be browser.newPage() which is rather inconvenient if I want to run several test scripts that all connect to one browser instance.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions