symfony-panther

Headless Google Chrome: How to prevent sites to know whether their window is focused or not

橙三吉。 提交于 2021-02-07 20:31:39
问题 Is there a way to prevent sites to know if they are visible or not? Perhaps a command line flag? I checked here but I could not find anything suitable https://peter.sh/experiments/chromium-command-line-switches/. I think they use the page visibility API: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API 回答1: If your goal is to fool the visibility API, then inject this piece of script in the related page or frame: await page.evaluate(` Object.defineProperty(window.document,

How can i set proxy server with symfony/panther

半世苍凉 提交于 2020-01-24 09:12:16
问题 I found two way of setting proxy server one is through chrome web driver capabilities and the other one is directly setting while creating chrome client $this->client = Client::createChromeClient(null, [ '--proxy-server=socks://196.14.52.63:35048', '--headless', "--disable-gpu", ]); but after setting proxy IP and port I get following error: Curl error thrown for http POST to /session/cce06908d68a1e96bc6d1cb3b798aa14/url with params: {"url":"https:\/\/some-site\/login"}\n Operation timed out

How can i set proxy server with symfony/panther

非 Y 不嫁゛ 提交于 2020-01-24 09:12:07
问题 I found two way of setting proxy server one is through chrome web driver capabilities and the other one is directly setting while creating chrome client $this->client = Client::createChromeClient(null, [ '--proxy-server=socks://196.14.52.63:35048', '--headless', "--disable-gpu", ]); but after setting proxy IP and port I get following error: Curl error thrown for http POST to /session/cce06908d68a1e96bc6d1cb3b798aa14/url with params: {"url":"https:\/\/some-site\/login"}\n Operation timed out