1

I want more sure, than my python selenium chrome will not detected. So, how i can avoide failed of these tests:

  1. https://bot.sannysoft.com/ CHR_MEMORY FAIL
  2. https://bot.incolumitas.com/ "inconsistentWebWorkerNavigatorPropery": "FAIL", "inconsistentServiceWorkerNavigatorPropery": "FAIL".

I read and used any helpfull recommendations like this,this or this but yet have no idea, how i can passed tests.

For CHR_MEMORY FAIL i used this:

driver.execute_script("Object.defineProperty(navigator, 'deviceMemory', {get: () => 8})")

or

driver.execute_cdp_cmd("Page.addScriptToEvaluateOnNewDocument", {
"source": """
                   Object.defineProperty(navigator, 'deviceMemory', {
                     get: () => Number(2)
                   });
                   """
 })

But both not work, however Fp-collect info points to "deviceMemory": 8. The rest of the tests my code passes successfully.

What mean this params from second tests set? WebWorkerNavigatorPropery ServiceWorkerNavigatorPropery How can i try to get around them too?

Any help is much appreciated

sannysoft results IMG

incolumitas results IMG

MrBrendan
  • 11
  • 4

1 Answers1

0

The whole problem lies in the user agent. try this sprit that i wrote below. Having registered a memory device and a user agent in one script. I struggled with this for a whole week until I tried this combination and it worked for me.

js.executeScript("Object.defineProperty(navigator, 'deviceMemory', {\n" +
                "                 get: () => 8\n" +
                "           });\n" +
                "           Object.defineProperty(navigator, 'userAgent', {\n" +
                "             get: () => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36'\n" +
                "           });");

1 2

Zenk0
  • 13
  • 1
  • 2