chrome-php / chrome

Instrument headless chrome/chromium instances from PHP
MIT License
2.27k stars 279 forks source link

Different work of headless mode #635

Open lusy777 opened 3 months ago

lusy777 commented 3 months ago

I noticed different work when I'm calling $browserFactory->createBrowser() with/without 'headless' => false With 'headless' => false appeared chrome window with load page and return full html page, but without this option I see in html response "..You don't have permission to access.. " I thought both modes were supposed to work the same?

enricodias commented 3 months ago

Probably the website is identifying the headless mode and changing its behaviour.

lusy777 commented 3 months ago

Is there any trick to fool this identifying?

enricodias commented 3 months ago

You can try tweaking the things that this tool checks for to detect headless: https://github.com/infosimples/detect-headless