Обнаружение WebDriver - PullRequest
0 голосов
/ 05 мая 2020

У меня проблема с обнаружением WebDrive. Я обменял selenium / standalone- chrome на dosel / zalenium и во время тестирования наткнулся на обнаружение WebDrive.

URL для тестов:

https://intoli.com/blog/not-possible-to-block-chrome-headless/chrome-headless-test.html https://intoli.com/blog/making-chrome-headless-undetectable/chrome-headless-test.html

Параметры моих возможностей:

'--headless',
'--no-sandbox',
'--start-maximized',
'--window-size=1920,1080',
'--disable-blink-features',
'--disable-blink-features=AutomationControlled',
'--disable-setuid-sandbox',
'--lang=en-US',
'--disable-infobars',
'--disable-notifications',
'--window-position=0,0',
'--ignore-certifcate-errors',
'--ignore-certifcate-errors-spki-list',

И я также пробовал:

$capabilitiesOptions->setExperimentalOption('useAutomationExtension', false);
$capabilitiesOptions->setExperimentalOption('excludeSwitches', ['enable-automation']);

С селеном / автономным - chrome работает нормально. Я пытался:

$client->executeScript("
  Object.defineProperty(navigator, 'webdriver', {
    get: () => undefined
  })
  Object.defineProperty(navigator, 'plugins', {
    get: () => [1,2,3,4,5]
  })
");

Но не работает. Как я могу перестать определять WebDriver?

...