Loading YouTube results in JCEF ERR_BLOCKED_BY_RESPONSE

Having problems with building or using the JCEF Java binding? Ask your questions here.

Loading YouTube results in JCEF ERR_BLOCKED_BY_RESPONSE

Postby jgcodes » Wed Jun 17, 2020 4:40 pm

Here are my logs.
Code: Select all
Using:
JCEF Version = 81.2.24.251
CEF Version = 81.2.24
Chromium Version = 81.0.4044.113
AppHandler.stateHasChanged: INITIALIZING
initialize on Thread[AWT-EventQueue-0,6,main] with library path .\jcef_build\native\Release
Added scheme search://
Added scheme client://
AppHandler.stateHasChanged: INITIALIZED
BrowserFrame.onAfterCreated id=1
[0617/171246.787:INFO:CONSOLE(0)] "A cookie associated with a cross-site resource at https://accounts.google.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.", source: https://www.youtube.com/ (0)
[0617/171246.804:INFO:CONSOLE(0)] "Refused to display 'https://accounts.google.com/ServiceLogin?service=youtube&continue=https%3A%2F%2Fwww.youtube.com%2Fsignin%3Ffeature%3Dpassive%26hl%3Den%26action_handle_signin%3Dtrue%26next%3D%252Fsignin_passive%26app%3Ddesktop&uilel=3&hl=en&passive=true' in a frame because it set 'X-Frame-Options' to 'deny'.", source: https://www.youtube.com/ (0)
BrowserFrame.windowClosing CefBrowser.close(false)
BrowserFrame.doClose id=1 CefBrowser.doClose=true
BrowserFrame.windowClosing CefBrowser.close(true)
BrowserFrame.windowClosing Frame.dispose
BrowserFrame.onBeforeClose id=1
BrowserFrame.onBeforeClose CefApp.dispose
AppHandler.stateHasChanged: SHUTTING_DOWN
shutdown on Thread[AWT-EventQueue-0,6,main]
AppHandler.stateHasChanged: TERMINATED
PS C:\Users\Stephen Hall\Desktop\JCEF\src\tools>

YouTube's homepage renders normally in Google Chrome 83.0.4103.106, but redirects to this in JCEF 81.2.24.251:
Image
The picture was created by opening YouTube with the detailed test. Is this a bug, or is this something that has already been solved?

EDIT: The default error handling behaviour appears to be related to CefLoadHandler.
jgcodes
Techie
 
Posts: 11
Joined: Fri Jun 05, 2020 10:16 am

Re: Loading YouTube results in JCEF ERR_BLOCKED_BY_RESPONSE

Postby ndesktop » Thu Jun 18, 2020 12:10 am

Since the request is on accounts.google.com, it is probably related to the Google accounts team (youtube, gmail etc.) which blocks logins from embedded Chromium clients, so also those based on CEF.
Try to run with --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0" to see if this behavior is fixed.
If so, I'm afraid you need to
- intercept requests before is fired
- maintain a list of Google domains where this tweak is needed
- if the request domain matches one of those domains, replace user agent with a Firefox or Edge one (this also needs to be maintained to avoid being classified as "browser too old")
- deliver the tweak file containing G-domains and the custom UA via updates to your installations.
ndesktop
Master
 
Posts: 754
Joined: Thu Dec 03, 2015 10:10 am

Re: Loading YouTube results in JCEF ERR_BLOCKED_BY_RESPONSE

Postby jgcodes » Thu Jun 18, 2020 9:39 am

After setting the user agent string (used devtools console to confirm), it appears that somehow Google's servers can still detect an embedded browser. I've sent feedback to YouTube and most likely won't get any response (Google is like that).
jgcodes
Techie
 
Posts: 11
Joined: Fri Jun 05, 2020 10:16 am

Re: Loading YouTube results in JCEF ERR_BLOCKED_BY_RESPONSE

Postby ndesktop » Thu Jun 18, 2020 10:16 am

I had a similar problem logging into GMail and I managed to solve it that way. Maybe they updated something, could be.
ndesktop
Master
 
Posts: 754
Joined: Thu Dec 03, 2015 10:10 am

Re: Loading YouTube results in JCEF ERR_BLOCKED_BY_RESPONSE

Postby jgcodes » Sun Jun 21, 2020 10:13 pm

I found that the detailed test load error handler goes absolutely brutal on errors which don't block page loading. YouTube loads just fine if the handler simply shows an alert dialog.
jgcodes
Techie
 
Posts: 11
Joined: Fri Jun 05, 2020 10:16 am


Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 10 guests