ulixee / hero

The web browser built for scraping
MIT License
646 stars 32 forks source link

Google issue #276

Open NN-Binary opened 2 weeks ago

NN-Binary commented 2 weeks ago

When browsing on Google, i.e https://www.google.com/intl/en-US/gmail/about/

There is an error: about/:137 [Report Only] This document requires 'TrustedScriptURL' assignment.

And then on the Login page, there is in the console: m=_b,_tp:117 Uncaught (in promise) TypeError: Illegal invocation

I've tried tweaking most things, userAgent latest... none at all... and all of them seems to not have Google work. Of course it does work with a normal browser.

blakebyrnes commented 1 week ago

It sounds from reading some articles like you can disable CSP (I don't know what side effects this has) - you would do this with a plugin that calls "Page.setBypassCSP" on newPage.

It seems like there might be some Man-in-the-middle events we're not properly relaying. I'm guessing your logs/db will have some of these that we're not passing on property: https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-trustTokenOperationDone

NN-Binary commented 1 week ago

Weirdly, even with disableMitm: true, the bug still arise. It feels like Google detect instantly any sort of Hero instance, regardless of MITM enabled. I have tried with many different useragent. When spawning regular chromium, the error is not present

blakebyrnes commented 1 week ago

Try removing the background-networking flag from the engine. That might also be part of it

NN-Binary commented 1 week ago

I tried removing absolutely EVERY flags, but still. (as in literally comment the entire array)

NN-Binary commented 1 week ago

Yeah, sadly it makes Hero unusable anymore :( Impossible to use any sort of Google accounts (Login form broken), regardless of flags.