override user agent metadata and other fixes#29
Open
iloveitaly wants to merge 11 commits intoAtuboDad:mainfrom
Open
override user agent metadata and other fixes#29iloveitaly wants to merge 11 commits intoAtuboDad:mainfrom
iloveitaly wants to merge 11 commits intoAtuboDad:mainfrom
Conversation
Updated goto link Replaced asyncio.eventloop() to asyncio.run() Added stealth arguments
Added full page screenshot for stealth with passed arguments with desired value *in this case: mimicking a mobile device*
support msedge (HeadlessEdg/)
Remove deprecated pkg_resources references
log not exist
buid 1.0.7 for local version
replace all 'Headless'
del all 'Headless'
Contributor
| const current_ua = navigator.userAgent | ||
| Object.defineProperty(Object.getPrototypeOf(navigator), 'userAgent', { | ||
| get: () => opts.navigator_user_agent || current_ua.replace('HeadlessChrome/', 'Chrome/') | ||
| get: () => opts.navigator_user_agent || current_ua.replace(/Headless/g, '') |
There was a problem hiding this comment.
There is no check if opts is undefined (also in the original code, yes). This will break scripts on other websites that rely on navigator.userAgent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





This PR contains improvements from this branch in addition
to further improvements necessary to mock out the
navigator.userAgentDataobject which was causing bot detection failuresin my case.
I've also made some slight improvements to the loading code to make it less repetitive.
I have some additional improvements locally that enable us to more easily determine possible differences betweeen headless & headful mode that I'd like to submit in a separate PR