Answer the question
In order to leave comments, you need to log in
How to pass the headless browser check?
found a service that determines if the browser is real
https://intoli.com/blog/not-possible-to-block-chro...
When I log in from a regular browser
Test Name Result
User Agent (Old) Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0
WebDriver (New) missing (passed)
Chrome (New) missing (failed)
Permissions (New) denied
Plugins Length (Old) 1
Languages (Old) ru-RU,ru,en-US,en
Test Name Result
User Agent (Old)
WebDriver (New) present (failed)
Chrome (New) missing (failed)
Permissions (New)
Plugins Length (Old)
Languages (Old)
$browserObj=\MTS\Factories::getDevices()->getLocalHost()->getBrowser('phantomjs');
$browserObj->setKeepalive(true);
$windowObj=$browserObj->getNewWindow();
$windowObj->setUserAgent('Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0');
$windowObj->setUrl('https://intoli.com/blog/not-possible-to-block-chrome-headless/chrome-headless-test.html');
$content=$windowObj->getDom();
echo $content;
$browserObj->terminate();
use Nesk\Puphpeteer\Puppeteer;
use Nesk\Rialto\Data\JsFunction;
use Nesk\Rialto\Exceptions\Node;
$puppeteer = new Puppeteer;
$browser = $puppeteer->launch([
'headless=false',
'args' => [
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-dev-shm-usage',
'--disable-gpu',
'--incognito',
],
]);
$page=$browser->newPage();
$page->setUserAgent('Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0');
$page->goto('https://intoli.com/blog/not-possible-to-block-chrome-headless/chrome-headless-test.html');
Test Name Result
User Agent (Old) Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0
WebDriver (New) present (failed)
Chrome (New) missing (failed)
Permissions (New) prompt
Plugins Length (Old) 0
Languages (Old) en-US
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question