Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

$browser->close(); is not working and it exit after idle_timeout only #153

Open
1 task done
beshoo opened this issue Oct 14, 2021 · 1 comment
Open
1 task done

Comments

@beshoo
Copy link

beshoo commented Oct 14, 2021

Describe the bug
Page take long time to close. it only close when idle_timeout is reached but not when I use $browser->close();

Reproducible example

<?php
error_reporting(E_ALL);
ini_set("display_errors", "1");

require 'vendor/autoload.php';
use Nesk\Puphpeteer\Puppeteer;

$puppeteer = new Puppeteer(['idle_timeout' => 10]);
$browser = $puppeteer->launch([
  'ignoreHTTPSErrors' => true,
  'headless' => true,
  'devtools' => false,
  'idle_timeout' => 30,
  'args' => [
                        '--disable-gpu',
                        '--no-sandbox',
                        '--no-first-run',
                        '--disable-setuid-sandbox',
                        '--no-zygote',
                        '--disable-dev-shm-usage',
                        '--disable-dev-profile',
                        '--user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36'
],
]);

//and auth if need
$page = $browser->newPage();
$page->goto('https://api.my-ip.io/ip');
$html = $page->content();
$page->close();
$browser->close();
print_r($html);

Expected behavior
Exit the PHP processes once reach print_r($html); but the case it is hang on for 10 sec then exit, which is the idle_timeout

Environment (please complete the following information):

  • OS: Linux server3.net 3.10.0-962.3.2.lve1.5.42.el7.x86_64 API documentation #1 SMP Mon Nov 9 08:11:18 EST 2020 x86_64 x86_64 x86_64 GNU/Linux

  • Node version: v14.17.6

  • PHP version

 PHP 7.4.23 (cli) (built: Sep  2 2021 13:47:56) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
[MAX]root:[/home/beshoo/www/phpchrome]

My Node package manager is:

  • NPM 6.14.15
@th-lange
Copy link

I think we are affected by that too...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants