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

Headless doesn't always work for all chrome based browsers, here's a fix #1301

Open
Redrrx opened this issue May 30, 2023 · 1 comment
Open

Comments

@Redrrx
Copy link

Redrrx commented May 30, 2023

The issue is minor, nothing critical and the work around is simple.
the strange behaviour was noticed when self.patch.version_main returns None and is being compared to an int which caused this error

Error: '<' not supported between instances of 'NoneType' and 'int'

i had to change this

        if headless or options.headless:
            if self.patcher.version_main < 108:
                options.add_argument("--headless=chrome")
            elif self.patcher.version_main >= 108:
                options.add_argument("--headless=new")

to

        if headless or options.headless:
            options.add_argument("--headless=new")

which is not really a good fix but a way to enforce latest browsers to use new headless, this could be handled much better but hey people can be forced to use latest versions it shouldn't hurt.. much better than adding a block of retro compatibility and welcomes the new headless version which actually executes JS and works fine with CF and other things!

@Redrrx Redrrx changed the title Headless doesn't always work for all chrome based browsers Headless doesn't always work for all chrome based browsers, here's a fix May 30, 2023
@ultrafunkamsterdam
Copy link
Owner

Unfortunately,and strangely, there are are still lots of < 108 users. Seems like the version_main is not set when using lower version . While typing this.... Thinking about maybe the endpoints don't offer these older versions. Going to check that. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants