Merge pull request #2 from TJM4/master
Fixed bug where webdriver property could be detected
This commit is contained in:
commit
bf360b9808
|
@ -46,8 +46,16 @@ class Chrome:
|
|||
"Page.addScriptToEvaluateOnNewDocument",
|
||||
{
|
||||
"source": """
|
||||
Object.defineProperty(navigator, 'webdriver', {
|
||||
get: () => undefined
|
||||
Object.defineProperty(window, 'navigator', {
|
||||
value: new Proxy(navigator, {
|
||||
has: (target, key) => (key === 'webdriver' ? false : key in target),
|
||||
get: (target, key) =>
|
||||
key === 'webdriver'
|
||||
? undefined
|
||||
: typeof target[key] === 'function'
|
||||
? target[key].bind(target)
|
||||
: target[key]
|
||||
})
|
||||
})
|
||||
"""
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue