Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inner and outer width/height inconsistency #79

Closed
flunkman opened this issue Nov 28, 2019 · 6 comments
Closed

Inner and outer width/height inconsistency #79

flunkman opened this issue Nov 28, 2019 · 6 comments
Labels
plugin: stealth ㊙️ Detection evasion related

Comments

@flunkman
Copy link

Hi there!

I may have spotted an issue with the stealth plugin.

When I use 'await page.setViewport({ width: 800, height: 600 })' I get this:

Screen Shot 11-27-19 at 10 19 PM

But if I raise the viewport dimensions, for instance 'await page.setViewport({ width: 1920, height: 1080 })' here is what I get:

Screen Shot 11-27-19 at 10 17 PM

As you can see several values like the outer width/height remains at 800x600 no matter what. Since those are lower than the inner width/height, some sites detect my headless Chrome and block it due to this simple test.

Are they hardcoded values or can we change them programmatically?

@berstend
Copy link
Owner

I remember that there was a discussion about this on the puppeteer issue tracker, If I recall correctly it matters when the viewport is set or something. I don't have time to look into this right now but please report any findings you might have :)

@berstend berstend added the plugin: stealth ㊙️ Detection evasion related label Nov 28, 2019
@berstend
Copy link
Owner

berstend commented Nov 28, 2019

@flunkman just found this through google (untested):

const browser = await puppeteer.launch({defaultViewport: null});

Set the defaultViewport option to null as above to disable the 800x600 resolution. It takes the max resolution then.

@berstend
Copy link
Owner

If this works we should seriously start a wiki with those stealth tips. 😄

@berstend
Copy link
Owner

I've added this to the new wiki: https://github.com/berstend/puppeteer-extra/wiki/Common-stealth-issues

@flunkman
Copy link
Author

flunkman commented Nov 28, 2019

The result is the same with 'defaultViewport: null'...

But I've managed to solve this issue by adding the '--window-size=1920,1080' argument to puppeteer.launch.

@LeninZapata
Copy link

The result is the same with 'defaultViewport: null'...

But I've managed to solve this issue by adding the '--window-size=1920,1080' argument to puppeteer.launch.

This doesn't work for me
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: stealth ㊙️ Detection evasion related
Projects
None yet
Development

No branches or pull requests

3 participants