You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a browser is created, a default page is also created, and the first call to browser->createPage() creates a second page.
Single-page scripts (which I assume is the majority of scripts) could benefit from accessing the initial page, it would be nice if we could get a
$factory = new \HeadlessChromium\BrowserFactory("chromium-browser");
$browser = $factory->createBrowser();
$page = $browser->getInitialPage();
which would presumably be somewhat faster and use less resources than $page = $browser->createPage();
just a "nice to have" feature, speeding up single-page scripts, but not important.
Also I checked if this initial page is available from $browser->getPages(); - it isn't. (have not looked into why.)
The text was updated successfully, but these errors were encountered:
I've noticed that in headless mode, $browser->getPages() returns an empty array, so you do need to create a page.
When headless is off, $browser->getPages() returns the initial page.
When a browser is created, a default page is also created, and the first call to browser->createPage() creates a second page.
Single-page scripts (which I assume is the majority of scripts) could benefit from accessing the initial page, it would be nice if we could get a
which would presumably be somewhat faster and use less resources than
$page = $browser->createPage();
just a "nice to have" feature, speeding up single-page scripts, but not important.
Also I checked if this initial page is available from
$browser->getPages();
- it isn't. (have not looked into why.)The text was updated successfully, but these errors were encountered: