brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.64k stars 2.3k forks source link

YouTube live chat remains blank for 30 seconds on live streams #25694

Closed snowbound closed 2 months ago

snowbound commented 2 years ago

Description

When one brings up a Live YouTube stream that also has a live chat. the live chat remains blank for 30 seconds

Steps to Reproduce

  1. Open up link to Live YouTube stream
  2. The chat window is blank even though video stream is playing

Actual result:

Expected result:

The live chat should display comments at the same time the live video starts playing

Reproduces how often:

Go to this stream for example

Brave version (brave://version info)

Version 1.45.75 Chromium: 106.0.5249.65

Version/Channel Information:

Other Additional Information:

Miscellaneous Information:

Outlined here in this [thread](https://community.brave.com/t/youtube-live-chat-30-sec-delay/432842/25

I have tried so many things over the past two weeks to narrow this issue down) at Brave Community

This issue is more noticeable when dealing with actual LIVE streams.

Yes, I have a new profile that has no extensions in it. I have tried the first 3 streams that Saoiray posted in that thread on the Brave community.

The first 2 streams are live streams and the chat takes 30 seconds to load. If I force a page to reload on these 2 streams it makes no difference. The 3rd stream, The Ramsey show is a recorded stream. That chat also takes 30 seconds to load HOWEVER once it gets into the cache then the chat loads fine when the page has a forced reload done on it. If you clear the browser's cache the issue comes back. I am on a 500Mbps symmetrical fibre connection.

I noticed this issue with LIVE streams in September. Before then the LIVE stream chats populated fine. This is not the first time however that this issue has happened in Brave.

[IAmDinkAMA in Brave's subreddit mentioned in a thread I started over there re this issue that he noticed that going to brave://net-internals/#dn and performing the clearing of host cache twice seemed to fix the issue when reloading of the page would cause the live chat to take 30 seconds to populate.

Alas that did not seem to fix the issue. I have tried this numerous times in an empty profile and whenever I cleared the browser cache in that profile the loading of the live chat takes 30 seconds or so. What I did notice was that during these 30 seconds Brave showed waiting for fonts.gstatic.com

P.S. I am using this live stream for my testing

snowbound commented 2 years ago

Still happening on [Version 1.45.78 Chromium: 106.0.5249.65 (Official Build) beta (64-bit)

ryanbr commented 1 year ago

I saw a brief delay then showed, then when I refresh the site it showed instantly (like caching the page). So works for me?

This is a Clean Brave Beta profile. No extensions.

snowbound commented 1 year ago

It is like a 20 sec delay on all live streams here before the live chat populates.

snowbound commented 1 year ago

I have attached the output from Devtools when I initiated a reload of my test stream Brave YT Chat issue.txt

snowbound commented 1 year ago

Is anyone from Brave Dev going to bother looking at the dump or should I just go back to MS Edge or Chrome the latter has no issues with chat populating properly?

snowbound commented 1 year ago

Further testing results https://community.brave.com/t/youtube-live-chat-30-sec-delay/432842/49?u=fedup if this was something on this computer outside of the browser then why is Chrome, Firefox and MS Edge Beta not experiencing this delay?

snowbound commented 1 year ago

This is a screen capture that I did in a new profile on Brave Beta. The issue is happening on a brand new WIndows10 computer here with Brave with a new profile. This new computer has no security software or antivirus other than the stock Windows10.

To have the issue occur

  1. Open empty tab.
  2. Clear cache.
  3. Paste in the URL for this test screen.
  4. Problem occurs.

This problem not occurring in Google Chrome, MS Edge or Firefox. I notice on occasion the browser is waiting for a gstatic or other google servers to respond.

Version 1.46.99 Chromium: 107.0.5304.91 (Official Build) beta (64-bit)

https://user-images.githubusercontent.com/596147/200667869-fa94e9a6-d2ad-4936-b568-f3f53b336c8f.mp4

snowbound commented 1 year ago

Version 1.47.91 Chromium: 108.0.5359.48 (Official Build) nightly (64-bit)](https://brave.com/latest/)

snowbound commented 1 year ago

On a clean install of Version 1.48.5 Chromium: 108.0.5359.48 (Official Build) nightly (64-bit) with no extensions, if the Brave shields are down a non-skippable ad plays followed by a skippable ad plays. The chat does not populate until the skippable ad is skipped. With Brave shields up and the tab reloads the video plays but the live chat is delayed by about 20 secs.

snowbound commented 1 year ago

This issue is indeed a Brave one. I installed Vivaldi with the same extensions and settings as those in Brave and Vivaldi has no issue with the YT Tube live streams chat populating as soon as the video stream starts.

lukemulks commented 1 year ago

Hi @snowbound - taking a look into this one as well.

lukemulks commented 1 year ago

Just attempted to reproduce from Win10 on:

1.48.32 Chromium: 108.0.5359.94 (Official Build) nightly (64-bit)

Chat loads within 2-3 seconds of page load for me.

Testing from this page provided at top of issue: https://www.youtube.com/watch?v=jfKfPfyJRdk

Going to update and attempt to repro from latest version of Nightly.

lukemulks commented 1 year ago

I was able to reproduce in:

1.48.41 Chromium: 108.0.5359.99 (Official Build) nightly (64-bit)

lukemulks commented 1 year ago

Was able to get some more info on refresh - I think I may have some indication of what could be going on here. Going to summon some bigger brains than mine on this one to double check.

I don't think it's an issue related to our filter lists for ad blocking.

When I refreshed, here's what I saw, which aligns with what @snowbound reported.

Here's a close-up of the area that jumped out at me when reviewing the console brave-yt-investigation-12092022-console-print-details

Tagging in @bsclifton @rebron who may know who best to tag in to put some eyeballs to test this theory, but here's what appears may be happening.

It looks like I'm seeing some timeouts with event handlers that may be taking place ahead of when GreaseLion loads.

Could be a race condition or some other conflict that's causing the chat not to initially load, but then begin displaying as expected when switching back and forth (alt+tab on win or command+tab on macos) between tabs.

Not 100% sure, but seems like it's a load order issue with how GreaseLion functions in this scenario - don't suspect it's filter list related, as if it were, I'd observe consistent behavior when toggling between tabs. Wouldn't expect the chat to begin displaying concurrently with video if this was a filter/shield issue.

Hope this helps - but one to dig in on given it's YT and Windows.

Brave-Matt commented 1 year ago

User left dev tools data dump info for review: Clean profile: Brave YouTube live chat issue dump1.txt Users regular profile: Brave YouTube live chat issue dump regular profile2.txt

cc @rebron @spylogsster

snowbound commented 1 year ago

Is there any more information Brave devs need from me for this 6+ month old issue? It is still happening on Version 1.49.91 Chromium: 110.0.5481.77

snowbound commented 1 year ago

This issue may be YT running preroll ads on live streams. I fired up MS Edge Beta today and it had what seemed to be a 30-60 second ad on a live stream. During the first 20 seconds of the ad the live chat would not populate. Once the ad reached a certain point the live chat showed up.

ghost commented 1 year ago

happens to me too on windows10 and brave [Version 1.49.120 Chromium: 111.0.5563.64 (Official Build) (64-bit)]

it appears to be random: sometimes it happens, and sometimes it doesn't.

snowbound commented 1 year ago

@sbernecchia the random is could be due to 2 issues.

The stream may not have any preroll non-skippable ads OR the stream has to be paused then the browser cache has to be cleared and the YT page for the stream has to be reloaded sometimes to see the effect. What I have discovered is that if one has UBlock installed in Brave using the standard block lists (with Brave shields down) you see the preroll ad that is causing the issue. If however, you have Brave shields enabled with ad blocking (aggressive or not) then the preroll ad is blocked HOWEVER the live chat populating is delayed until the 20-second mark of the non-skippable preroll ad gets to the 20-second mark.

Even if Brave has no additional filter list items checked it is still blocking the preroll ad but can not fix the live chat populating until the 20-second mark. This issue has existed since early Sept 2022 in Brave all builds. Others are no doubt seeing this issue but do not realize the chat issue is caused by preroll non-skippable ads.

Vivavaldi even with UBlock Origin installed using the same settings as UBlock in Brave does not have this chat issue. I see the chat populate right away

ScrapBlox commented 1 year ago

Happens to me to. View this post for my brave/windows setup

snowbound commented 1 year ago

@ScrapBlox Thanks for adding your voice to this bug in Brave. So frustrating to see a browser like Vivaldi have no such issue yet Brave does no matter what rules or rule set you select for ad blocking.

snowbound commented 1 year ago

It is up to Brave Devs to figure this bug out. I had a YT stream where I disabled all ad blocking and saw no ads yet I saw the 20 second delay in loading the chat. I as an end user can only do so much. I have seen this happen on countless systems here some with a brand new clean install on a clean Win10 install with no extensions. I have had friends having the same issue with YT chat.

I give up @lukemulks

ScrapBlox commented 1 year ago

Yup I've already given up on brave browser as I need youtube live and chats. As a viewer and broadcaster I need it. I now use vivaldi

snowbound commented 1 year ago

@ScrapBlox especially when you have to moderate live chats 20 seconds seems like an eternity.

snowbound commented 1 year ago

@rebron This issue is not only happening in Live YT streams but recordings which have YT chats included in the recording. One example is https://www.youtube.com/watch?v=FqSg1tykt2s

You see this just before chat does load

vTools failed to load source map: Could not load content for https://www.youtube.com/s/desktop/945ad0b2/jsbin/web-animations-next-lite.min.vflset/web-animations-next-lite.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE /generate_204?_2GK2A:1 GET https://www.youtube.com/generate_204?_2GK2A net::ERR_BLOCKED_BYCLIENT Image (async) eval @ VM6459:1 GJ @ watch:1 eval @ watch:1 Rl @ watch:1 li @ watch:1 N @ watch:1 d @ watch:1 C @ watch:1 Y.IxX_ @ watch:1 eq @ watch:1 $e @ watch:1 Xj @ base.js:773 oJa @ base.js:4108 (anonymous) @ base.js:4107 (anonymous) @ spf.js:24 r @ spf.js:19 Db @ spf.js:24 Pb @ spf.js:33 (anonymous) @ spf.js:18 setTimeout (async) g @ spf.js:34 load (async) Rb @ spf.js:34 Nb @ spf.js:32 ec @ spf.js:41 (anonymous) @ base.js:2237 pJa @ base.js:4107 (anonymous) @ base.js:9372 wJa @ base.js:4115 (anonymous) @ base.js:4128 (anonymous) @ base.js:4145 Promise.then (async) PJa @ base.js:4145 (anonymous) @ base.js:11306 (anonymous) @ base.js:7940 live_chat_polymer.js:2315 LegacyDataMixin will be applied to all legacy elements. Set _legacyUndefinedCheck: true on element class to enable. 9The resource was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally. base.js:1867 POST https://www.youtube.com/api/stats/qoe?fmt=247&afmt=251&cpn=iP9IkwNZTHTCTkgy&el=detailpage&ns=yt&fexp=23983296%2C23986019%2C24004644%2C24007246%2C24080738%2C24135310%2C24219382%2C24255165%2C24405913%2C24415864%2C24416291%2C24433679%2C24437577%2C24439361%2C24449113%2C24460285%2C24462372%2C24468691%2C24469652%2C24489377%2C24499532%2C24499792%2C24514873%2C24515201%2C24516157%2C24539776%2C24550457%2C24558068%2C39323074&cl=526486891&seq=2&docid=FqSg1tykt2s&ei=_o1JZNL6HYv92_gP6NOruAk&event=streamingstats&plid=AAX6Q1rpSTWSOToT&cbr=Chrome&cbrver=112.0.0.0&c=WEB&cver=2.20230425.08.00&cplayer=UNIPLAYER&cos=Windows&cosver=10.0&cplatform=DESKTOP&cmt=0.044:0.000,2.458:508.827,3.964:508.827,4.820:509.674,10.570:515.425&vps=0.044:B,2.458:S,3.964:PL,10.570:PL&ctmp=mdstm:t.3632;rst4disc.d;cd.0.000;sq.-1,mdstm:t.3740;rst4disc.d;cd.0.000;sq.-1&bh=3.964:1.174,10.570:0.000&bwm=10.570:4884769:3.659&bwe=10.570:782041&bat=10.570:1:1&df=10.570:2 net::ERR_BLOCKED_BY_CLIENT Gy @ base.js:1867 (anonymous) @ base.js:1852 JYa @ base.js:5752 (anonymous) @ base.js:5766 (anonymous) @ base.js:8179 PYa @ base.js:5765 (anonymous) @ base.js:11020 (anonymous) @ base.js:5770 (anonymous) @ base.js:1821 www.google.com/pagead/lvz?evtid=AAnBwfY-14ojTD6O7qrdCeP7l9zbtE1S7nQdkeFpSPa49vlQyqUiyStGbQ2uflJS8aImSuXrUS3GRVHoLBuFaYdjrhh7aPOfzg&req_ts=1682542078&pg=MainAppBootstrap%3AWatch&az=1&sigh=ADCDuE9adZDcWy_K4Avwl_lRPzGRY7OHXw:1 GET https://www.google.com/pagead/lvz?evtid=AAnBwfY-14ojTD6O7qrdCeP7l9zbtE1S7nQdkeFpSPa49vlQyqUiyStGbQ2uflJS8aImSuXrUS3GRVHoLBuFaYdjrhh7aPOfzg&req_ts=1682542078&pg=MainAppBootstrap%3AWatch&az=1&sigh=ADCDuE9adZDcWy_K4Avwl_lRPzGRY7OHXw net::ERR_BLOCKED_BY_CLIENT Image (async) Era @ desktop_polymer.js:1866 $m @ desktop_polymer.js:1863 UFc @ desktop_polymer.js:22019 P @ scheduler.js:30 V @ scheduler.js:39 (anonymous) @ scheduler.js:35 (anonymous) @ web-animations-next-lite.min.js:96 requestAnimationFrame (async) (anonymous) @ web-animations-next-lite.min.js:96 (anonymous) @ scheduler.js:40 Q @ scheduler.js:26 pa @ scheduler.js:45 (anonymous) @ desktop_polymer.js:1571 sAb @ desktop_polymer.js:9927 tAb @ desktop_polymer.js:9931 (anonymous) @ desktop_polymer.js:9930 vl @ desktoppolymer.js:1565 requestRenderChunk @ desktop_polymer.js:11509 (anonymous) @ desktop_polymer.js:11508 (anonymous) @ desktop_polymer.js:3442 fHa @ desktop_polymer.js:3134 characterData (async) run @ desktop_polymer.js:3141 (anonymous) @ desktop_polymer.js:3802 attached @ desktop_polymer.js:10233 (anonymous) @ desktop_polymer.js:3832 (anonymous) @ desktop_polymer.js:3760 attachShadow @ webcomponents-sd.js:95 (anonymous) @ webcomponents-sd.js:123 (anonymous) @ desktop_polymer.js:3361 (anonymous) @ desktop_polymer.js:3360 (anonymous) @ desktop_polymer.js:3283 (anonymous) @ desktop_polymer.js:3289 (anonymous) @ desktop_polymer.js:3160 (anonymous) @ desktop_polymer.js:3287 (anonymous) @ desktop_polymer.js:3359 (anonymous) @ desktop_polymer.js:3669 (anonymous) @ desktop_polymer.js:3769 (anonymous) @ desktop_polymer.js:3831 (anonymous) @ desktop_polymer.js:3159 (anonymous) @ desktop_polymer.js:3758 (anonymous) @ desktop_polymer.js:3179 (anonymous) @ desktop_polymer.js:3358 (anonymous) @ desktop_polymer.js:3670 (anonymous) @ desktop_polymer.js:3760 attachShadow @ webcomponents-sd.js:95 (anonymous) @ webcomponents-sd.js:123 (anonymous) @ desktop_polymer.js:3361 (anonymous) @ desktop_polymer.js:3360 (anonymous) @ desktop_polymer.js:3283 (anonymous) @ desktop_polymer.js:3289 (anonymous) @ desktop_polymer.js:3160 (anonymous) @ desktop_polymer.js:3287 (anonymous) @ desktop_polymer.js:3359 (anonymous) @ desktop_polymer.js:3669 (anonymous) @ desktop_polymer.js:3769 (anonymous) @ desktop_polymer.js:3831 (anonymous) @ desktop_polymer.js:3159 (anonymous) @ desktop_polymer.js:3758 (anonymous) @ desktop_polymer.js:3179 (anonymous) @ desktop_polymer.js:3358 (anonymous) @ desktop_polymer.js:3670 (anonymous) @ desktop_polymer.js:3760 attachShadow @ webcomponents-sd.js:95 (anonymous) @ webcomponents-sd.js:123 (anonymous) @ desktop_polymer.js:3361 (anonymous) @ desktop_polymer.js:3360 (anonymous) @ desktop_polymer.js:3283 (anonymous) @ desktop_polymer.js:3289 (anonymous) @ desktop_polymer.js:3160 (anonymous) @ desktop_polymer.js:3287 (anonymous) @ desktop_polymer.js:3359 (anonymous) @ desktop_polymer.js:3669 (anonymous) @ desktop_polymer.js:3769 (anonymous) @ desktop_polymer.js:3831 (anonymous) @ desktop_polymer.js:3159 (anonymous) @ desktop_polymer.js:3758 (anonymous) @ desktop_polymer.js:3179 (anonymous) @ desktop_polymer.js:3358 (anonymous) @ desktop_polymer.js:3670 (anonymous) @ desktoppolymer.js:3760 insertBefore @ webcomponents-sd.js:64 (anonymous) @ webcomponents-sd.js:121 stampDomArraySplices @ desktoppolymer.js:10208 rendererStamperApplyChangeRecord @ desktoppolymer.js:10204 rendererStamperObserver @ desktop_polymer.js:10201 THa @ desktop_polymer.js:3255 Yq @ desktop_polymer.js:3237 (anonymous) @ desktop_polymer.js:3289 (anonymous) @ desktop_polymer.js:3160 (anonymous) @ desktop_polymer.js:3281 (anonymous) @ desktop_polymer.js:3304 eIa @ desktop_polymer.js:3262 Zq @ desktop_polymer.js:3263 (anonymous) @ desktoppolymer.js:3299 fillRange @ desktoppolymer.js:11507 renderChunk @ desktop_polymer.js:11511 (anonymous) @ desktop_polymer.js:9925 P @ scheduler.js:30 V @ scheduler.js:39 (anonymous) @ scheduler.js:35 (anonymous) @ web-animations-next-lite.min.js:96 requestAnimationFrame (async) (anonymous) @ web-animations-next-lite.min.js:96 (anonymous) @ scheduler.js:40 Q @ scheduler.js:26 pa @ scheduler.js:45 (anonymous) @ desktop_polymer.js:1571 sAb @ desktop_polymer.js:9927 tAb @ desktop_polymer.js:9931 (anonymous) @ desktop_polymer.js:9930 vl @ desktoppolymer.js:1565 requestRenderChunk @ desktop_polymer.js:11509 (anonymous) @ desktop_polymer.js:11508 (anonymous) @ desktop_polymer.js:3442 fHa @ desktop_polymer.js:3134 characterData (async) run @ desktop_polymer.js:3141 (anonymous) @ desktop_polymer.js:3802 attached @ desktop_polymer.js:10233 (anonymous) @ desktop_polymer.js:3832 (anonymous) @ desktop_polymer.js:3760 attachShadow @ webcomponents-sd.js:95 (anonymous) @ webcomponents-sd.js:123 (anonymous) @ desktop_polymer.js:3361 (anonymous) @ desktop_polymer.js:3360 (anonymous) @ desktop_polymer.js:3283 (anonymous) @ desktop_polymer.js:3289 (anonymous) @ desktop_polymer.js:3160 (anonymous) @ desktop_polymer.js:3287 (anonymous) @ desktop_polymer.js:3359 (anonymous) @ desktop_polymer.js:3669 (anonymous) @ desktop_polymer.js:3769 (anonymous) @ desktop_polymer.js:3831 (anonymous) @ desktop_polymer.js:3159 (anonymous) @ desktop_polymer.js:3758 (anonymous) @ desktop_polymer.js:3179 (anonymous) @ desktop_polymer.js:3358 (anonymous) @ desktop_polymer.js:3670 (anonymous) @ desktop_polymer.js:3760 attachShadow @ webcomponents-sd.js:95 (anonymous) @ webcomponents-sd.js:123 (anonymous) @ desktop_polymer.js:3361 (anonymous) @ desktop_polymer.js:3360 (anonymous) @ desktop_polymer.js:3283 (anonymous) @ desktop_polymer.js:3289 (anonymous) @ desktop_polymer.js:3160 (anonymous) @ desktop_polymer.js:3287 (anonymous) @ desktop_polymer.js:3359 (anonymous) @ desktop_polymer.js:3669 (anonymous) @ desktop_polymer.js:3769 (anonymous) @ desktop_polymer.js:3831 (anonymous) @ desktop_polymer.js:3159 (anonymous) @ desktop_polymer.js:3758 (anonymous) @ desktop_polymer.js:3179 (anonymous) @ desktop_polymer.js:3358 (anonymous) @ desktop_polymer.js:3670 (anonymous) @ desktop_polymer.js:3760 attachShadow @ webcomponents-sd.js:95 (anonymous) @ webcomponents-sd.js:123 (anonymous) @ desktop_polymer.js:3361 (anonymous) @ desktop_polymer.js:3360 (anonymous) @ desktop_polymer.js:3283 (anonymous) @ desktop_polymer.js:3289 (anonymous) @ desktop_polymer.js:3160 (anonymous) @ desktop_polymer.js:3287 (anonymous) @ desktop_polymer.js:3359 (anonymous) @ desktop_polymer.js:3669 (anonymous) @ desktop_polymer.js:3769 (anonymous) @ desktop_polymer.js:3831 (anonymous) @ desktop_polymer.js:3159 (anonymous) @ desktop_polymer.js:3758 (anonymous) @ desktop_polymer.js:3179 (anonymous) @ desktop_polymer.js:3358 (anonymous) @ desktop_polymer.js:3670 (anonymous) @ desktoppolymer.js:3760 insertBefore @ webcomponents-sd.js:64 (anonymous) @ webcomponents-sd.js:121 stampDomArraySplices @ desktoppolymer.js:10208 rendererStamperApplyChangeRecord @ desktoppolymer.js:10204 rendererStamperObserver @ desktop_polymer.js:10201 THa @ desktop_polymer.js:3255 Yq @ desktop_polymer.js:3237 (anonymous) @ desktop_polymer.js:3289 (anonymous) @ desktop_polymer.js:3160 (anonymous) @ desktop_polymer.js:3281 (anonymous) @ desktop_polymer.js:3304 eIa @ desktop_polymer.js:3262 Zq @ desktop_polymer.js:3263 (anonymous) @ desktoppolymer.js:3299 fillRange @ desktoppolymer.js:11507 renderChunk @ desktop_polymer.js:11511 (anonymous) @ desktop_polymer.js:9925 P @ scheduler.js:30 V @ scheduler.js:39 (anonymous) @ scheduler.js:35 (anonymous) @ web-animations-next-lite.min.js:96 requestAnimationFrame (async) (anonymous) @ web-animations-next-lite.min.js:96 (anonymous) @ scheduler.js:40 Q @ scheduler.js:26 pa @ scheduler.js:45 (anonymous) @ desktop_polymer.js:1571 sAb @ desktop_polymer.js:9927 tAb @ desktop_polymer.js:9931 (anonymous) @ desktop_polymer.js:9930 vl @ desktoppolymer.js:1565 requestRenderChunk @ desktop_polymer.js:11509 (anonymous) @ desktop_polymer.js:11508 (anonymous) @ desktop_polymer.js:3442 fHa @ desktop_polymer.js:3134 characterData (async) run @ desktop_polymer.js:3141 (anonymous) @ desktop_polymer.js:3802 attached @ desktop_polymer.js:10233 (anonymous) @ desktop_polymer.js:3832 (anonymous) @ desktop_polymer.js:3760 attachShadow @ webcomponents-sd.js:95 (anonymous) @ webcomponents-sd.js:123 (anonymous) @ desktop_polymer.js:3361 (anonymous) @ desktop_polymer.js:3360 (anonymous) @ desktop_polymer.js:3283 (anonymous) @ desktop_polymer.js:3289 (anonymous) @ desktop_polymer.js:3160 (anonymous) @ desktop_polymer.js:3287 (anonymous) @ desktop_polymer.js:3359 (anonymous) @ desktop_polymer.js:3669 (anonymous) @ desktop_polymer.js:3769 (anonymous) @ desktop_polymer.js:3831 (anonymous) @ desktop_polymer.js:3159 (anonymous) @ desktop_polymer.js:3758 (anonymous) @ desktop_polymer.js:3179 (anonymous) @ desktop_polymer.js:3358 (anonymous) @ desktop_polymer.js:3670 (anonymous) @ desktop_polymer.js:3760 attachShadow @ webcomponents-sd.js:95 (anonymous) @ webcomponents-sd.js:123 (anonymous) @ desktop_polymer.js:3361 (anonymous) @ desktop_polymer.js:3360 (anonymous) @ desktop_polymer.js:3283 (anonymous) @ desktop_polymer.js:3289 (anonymous) @ desktop_polymer.js:3160 (anonymous) @ desktop_polymer.js:3287 (anonymous) @ desktop_polymer.js:3359 (anonymous) @ desktop_polymer.js:3669 (anonymous) @ desktop_polymer.js:3769 (anonymous) @ desktop_polymer.js:3831 (anonymous) @ desktop_polymer.js:3159 (anonymous) @ desktop_polymer.js:3758 (anonymous) @ desktop_polymer.js:3179 (anonymous) @ desktop_polymer.js:3358 (anonymous) @ desktop_polymer.js:3670 (anonymous) @ desktop_polymer.js:3760 attachShadow @ webcomponents-sd.js:95 (anonymous) @ webcomponents-sd.js:123 (anonymous) @ desktop_polymer.js:3361 (anonymous) @ desktop_polymer.js:3360 (anonymous) @ desktop_polymer.js:3283 (anonymous) @ desktop_polymer.js:3289 (anonymous) @ desktop_polymer.js:3160 (anonymous) @ desktop_polymer.js:3287 (anonymous) @ desktop_polymer.js:3359 (anonymous) @ desktop_polymer.js:3669 (anonymous) @ desktop_polymer.js:3769 (anonymous) @ desktop_polymer.js:3831 (anonymous) @ desktop_polymer.js:3159 (anonymous) @ desktop_polymer.js:3758 (anonymous) @ desktop_polymer.js:3179 (anonymous) @ desktop_polymer.js:3358 (anonymous) @ desktop_polymer.js:3670 (anonymous) @ desktoppolymer.js:3760 insertBefore @ webcomponents-sd.js:64 (anonymous) @ webcomponents-sd.js:121 stampDomArraySplices @ desktoppolymer.js:10208 rendererStamperApplyChangeRecord @ desktoppolymer.js:10204 rendererStamperObserver @ desktop_polymer.js:10201 THa @ desktop_polymer.js:3255 Yq @ desktop_polymer.js:3237 (anonymous) @ desktop_polymer.js:3289 (anonymous) @ desktop_polymer.js:3160 (anonymous) @ desktop_polymer.js:3281 (anonymous) @ desktop_polymer.js:3304 eIa @ desktop_polymer.js:3262 Zq @ desktop_polymer.js:3263 (anonymous) @ desktoppolymer.js:3299 fillRange @ desktoppolymer.js:11507 renderChunk @ desktop_polymer.js:11511 (anonymous) @ desktop_polymer.js:9925 P @ scheduler.js:30 V @ scheduler.js:39 (anonymous) @ scheduler.js:35 (anonymous) @ web-animations-next-lite.min.js:96 requestAnimationFrame (async) (anonymous) @ web-animations-next-lite.min.js:96 (anonymous) @ scheduler.js:40 Q @ scheduler.js:26 pa @ scheduler.js:45 (anonymous) @ desktop_polymer.js:1571 sAb @ desktop_polymer.js:9927 tAb @ desktop_polymer.js:9931 (anonymous) @ desktop_polymer.js:9930 vl @ desktoppolymer.js:1565 requestRenderChunk @ desktop_polymer.js:11509 (anonymous) @ desktop_polymer.js:11508 (anonymous) @ desktop_polymer.js:3442 fHa @ desktop_polymer.js:3134 characterData (async) run @ desktop_polymer.js:3141 (anonymous) @ desktop_polymer.js:3802 attached @ desktop_polymer.js:10233 (anonymous) @ desktop_polymer.js:3832 (anonymous) @ desktop_polymer.js:3760 attachShadow @ webcomponents-sd.js:95 (anonymous) @ webcomponents-sd.js:123 (anonymous) @ desktop_polymer.js:3361 (anonymous) @ desktop_polymer.js:3360 (anonymous) @ desktop_polymer.js:3283 (anonymous) @ desktop_polymer.js:3289 (anonymous) @ desktop_polymer.js:3160 (anonymous) @ desktop_polymer.js:3287 (anonymous) @ desktop_polymer.js:3359 (anonymous) @ desktop_polymer.js:3669 (anonymous) @ desktop_polymer.js:3769 (anonymous) @ desktop_polymer.js:3831 (anonymous) @ desktop_polymer.js:3159 (anonymous) @ desktop_polymer.js:3758 (anonymous) @ desktop_polymer.js:3179 (anonymous) @ desktop_polymer.js:3358 (anonymous) @ desktop_polymer.js:3670 (anonymous) @ desktop_polymer.js:3760 attachShadow @ webcomponents-sd.js:95 (anonymous) @ webcomponents-sd.js:123 (anonymous) @ desktop_polymer.js:3361 (anonymous) @ desktop_polymer.js:3360 (anonymous) @ desktop_polymer.js:3283 (anonymous) @ desktop_polymer.js:3289 (anonymous) @ desktop_polymer.js:3160 (anonymous) @ desktop_polymer.js:3287 (anonymous) @ desktop_polymer.js:3359 (anonymous) @ desktop_polymer.js:3669 (anonymous) @ desktop_polymer.js:3769 (anonymous) @ desktop_polymer.js:3831 (anonymous) @ desktop_polymer.js:3159 (anonymous) @ desktop_polymer.js:3758 (anonymous) @ desktop_polymer.js:3179 (anonymous) @ desktop_polymer.js:3358 (anonymous) @ desktop_polymer.js:3670 (anonymous) @ desktop_polymer.js:3760 attachShadow @ webcomponents-sd.js:95 (anonymous) @ webcomponents-sd.js:123 (anonymous) @ desktop_polymer.js:3361 (anonymous) @ desktop_polymer.js:3360 (anonymous) @ desktop_polymer.js:3283 (anonymous) @ desktop_polymer.js:3289 (anonymous) @ desktop_polymer.js:3160 (anonymous) @ desktop_polymer.js:3287 (anonymous) @ desktop_polymer.js:3359 (anonymous) @ desktop_polymer.js:3669 (anonymous) @ desktop_polymer.js:3769 (anonymous) @ desktop_polymer.js:3831 (anonymous) @ desktop_polymer.js:3159 (anonymous) @ desktop_polymer.js:3758 (anonymous) @ desktop_polymer.js:3179 (anonymous) @ desktop_polymer.js:3358 (anonymous) @ desktop_polymer.js:3670 (anonymous) @ desktoppolymer.js:3760 insertBefore @ webcomponents-sd.js:64 (anonymous) @ webcomponents-sd.js:121 stampDomArraySplices @ desktoppolymer.js:10208 rendererStamperApplyChangeRecord @ desktoppolymer.js:10204 rendererStamperObserver @ desktop_polymer.js:10201 THa @ desktop_polymer.js:3255 Yq @ desktop_polymer.js:3237 (anonymous) @ desktop_polymer.js:3289 (anonymous) @ desktop_polymer.js:3160 (anonymous) @ desktop_polymer.js:3281 (anonymous) @ desktop_polymer.js:3304 eIa @ desktop_polymer.js:3262 Zq @ desktop_polymer.js:3263 (anonymous) @ desktoppolymer.js:3299 fillRange @ desktoppolymer.js:11507 renderChunk @ desktop_polymer.js:11511 (anonymous) @ desktop_polymer.js:9925 P @ scheduler.js:30 V @ scheduler.js:39 (anonymous) @ scheduler.js:35 (anonymous) @ web-animations-next-lite.min.js:96 requestAnimationFrame (async) (anonymous) @ web-animations-next-lite.min.js:96 (anonymous) @ scheduler.js:40 Q @ scheduler.js:26 pa @ scheduler.js:45 (anonymous) @ desktop_polymer.js:1571 sAb @ desktop_polymer.js:9927 tAb @ desktop_polymer.js:9931 (anonymous) @ desktop_polymer.js:9930 vl @ desktoppolymer.js:1565 requestRenderChunk @ desktop_polymer.js:11509 (anonymous) @ desktop_polymer.js:11508 (anonymous) @ desktop_polymer.js:3442 fHa @ desktop_polymer.js:3134 characterData (async) run @ desktop_polymer.js:3141 (anonymous) @ desktop_polymer.js:3802 attached @ desktop_polymer.js:10233 (anonymous) @ desktop_polymer.js:3832 (anonymous) @ desktop_polymer.js:3760 attachShadow @ webcomponents-sd.js:95 (anonymous) @ webcomponents-sd.js:123 (anonymous) @ desktop_polymer.js:3361 (anonymous) @ desktop_polymer.js:3360 (anonymous) @ desktop_polymer.js:3283 (anonymous) @ desktop_polymer.js:3289 (anonymous) @ desktop_polymer.js:3160 (anonymous) @ desktop_polymer.js:3287 (anonymous) @ desktop_polymer.js:3359 (anonymous) @ desktop_polymer.js:3669 (anonymous) @ desktop_polymer.js:3769 (anonymous) @ desktop_polymer.js:3831 (anonymous) @ desktop_polymer.js:3159 (anonymous) @ desktop_polymer.js:3758 (anonymous) @ desktop_polymer.js:3179 (anonymous) @ desktop_polymer.js:3358 (anonymous) @ desktop_polymer.js:3670 (anonymous) @ desktop_polymer.js:3760 attachShadow @ webcomponents-sd.js:95 (anonymous) @ webcomponents-sd.js:123 (anonymous) @ desktop_polymer.js:3361 (anonymous) @ desktop_polymer.js:3360 (anonymous) @ desktop_polymer.js:3283 (anonymous) @ desktop_polymer.js:3289 (anonymous) @ desktop_polymer.js:3160 (anonymous) @ desktop_polymer.js:3287 (anonymous) @ desktop_polymer.js:3359 (anonymous) @ desktop_polymer.js:3669 (anonymous) @ desktop_polymer.js:3769 (anonymous) @ desktop_polymer.js:3831 (anonymous) @ desktop_polymer.js:3159 (anonymous) @ desktop_polymer.js:3758 (anonymous) @ desktop_polymer.js:3179 (anonymous) @ desktop_polymer.js:3358 (anonymous) @ desktop_polymer.js:3670 (anonymous) @ desktop_polymer.js:3760 attachShadow @ webcomponents-sd.js:95 (anonymous) @ webcomponents-sd.js:123 (anonymous) @ desktop_polymer.js:3361 (anonymous) @ desktop_polymer.js:3360 (anonymous) @ desktop_polymer.js:3283 (anonymous) @ desktop_polymer.js:3289 (anonymous) @ desktop_polymer.js:3160 (anonymous) @ desktop_polymer.js:3287 (anonymous) @ desktop_polymer.js:3359 (anonymous) @ desktop_polymer.js:3669 (anonymous) @ desktop_polymer.js:3769 (anonymous) @ desktop_polymer.js:3831 (anonymous) @ desktop_polymer.js:3159 (anonymous) @ desktop_polymer.js:3758 (anonymous) @ desktop_polymer.js:3179 (anonymous) @ desktop_polymer.js:3358 (anonymous) @ desktop_polymer.js:3670 (anonymous) @ desktoppolymer.js:3760 insertBefore @ webcomponents-sd.js:64 (anonymous) @ webcomponents-sd.js:121 stampDomArraySplices @ desktoppolymer.js:10208 rendererStamperApplyChangeRecord @ desktoppolymer.js:10204 rendererStamperObserver @ desktop_polymer.js:10201 THa @ desktop_polymer.js:3255 Yq @ desktop_polymer.js:3237 (anonymous) @ desktop_polymer.js:3289 (anonymous) @ desktop_polymer.js:3160 (anonymous) @ desktop_polymer.js:3281 (anonymous) @ desktop_polymer.js:3304 eIa @ desktop_polymer.js:3262 Zq @ desktop_polymer.js:3263 (anonymous) @ desktoppolymer.js:3299 fillRange @ desktoppolymer.js:11507 renderChunk @ desktop_polymer.js:11511 (anonymous) @ desktop_polymer.js:9925 P @ scheduler.js:30 V @ scheduler.js:39 (anonymous) @ scheduler.js:35 (anonymous) @ web-animations-next-lite.min.js:96 www.google.ca/pagead/lvz?evtid=AAnBwfY-14ojTD6O7qrdCeP7l9zbtE1S7nQdkeFpSPa49vlQyqUiyStGbQ2uflJS8aImSuXrUS3GRVHoLBuFaYdjrhh7aPOfzg&req_ts=1682542078&pg=MainAppBootstrap%3AWatch&az=1&sigh=ADCDuE9adZDcWy_K4Avwl_lRPzGRY7OHXw:1 GET https://www.google.ca/pagead/lvz?evtid=AAnBwfY-14ojTD6O7qrdCeP7l9zbtE1S7nQdkeFpSPa49vlQyqUiyStGbQ2uflJS8aImSuXrUS3GRVHoLBuFaYdjrhh7aPOfzg&req_ts=1682542078&pg=MainAppBootstrap%3AWatch&az=1&sigh=ADCDuE9adZDcWy_K4Avwl_lRPzGRY7OHXw net::ERR_BLOCKED_BY_CLIENT Image

snowbound commented 1 year ago

@Brave-Matt

Sigh. This is even happening in Brave Version 1.53.5 Chromium: 113.0.5672.53 (Official Build) nightly (64-bit). If you go to https://www.youtube.com/watch?v=jfKfPfyJRdk and force a reload of the page the chat will take 20+ seconds to show up. Out of 10 forced reloads on the page 6 of the 10 reloads caused the chat to take 20+ seconds to populate!!

If that is normal for Brave please will someone from Brave here tell me so and I will ditch Brave from all my systems and mobile. Imagine being a content creator on YouTube and having to wait 20+ seconds before you see the chat or before your moderators can start their moderation. Twenty seconds can feel like an eternity.

snowbound commented 1 year ago

This is from the stream I use for testing https://www.youtube.com/watch?v=jfKfPfyJRdk on Windows10

image

Where the arrow is about where the live chat finally decided to populate properly. This is from Brave Version 1.53.10 Chromium: 113.0.5672.63 (Official Build) nightly (64-bit)

This issue is across all 3 versions of Brave. If the issue does not occur the first time a stream in YT is played then repeated reloading of that live stream will cause the issue to occur. I have yet to see a live stream does not exhibit this issue.

snowbound commented 1 year ago

If a live stream has an issue loading the chat when one starts playing the stream, the symptom also occurs if you then hide the chat and then try to show the chat. You have to wait 20+ seconds for the chat to show up. If the stream has no such issue when initially playing it then hiding and show chat works as expected.

bsclifton commented 1 year ago

When testing with @ryanbr, it seemed to show (for both of us) on average every 1/10 times. The other 9 times the chat loads fine. I did find a request which took a long time to process... this might be a good clue

Basically, with the Dev Tools / Network tab open, I waited until the 1. The issue reproduced 2. The chat showed itself after 20-30 seconds.

Then looked for the long running requests. I narrowed down to the outbound request I had for:

https://www.youtube.com/live_chat?continuation=0ofMyAN-Gl5DaWtxSndvWVZVTlRTalJuYTFaRE5rNXlka2xKT0hWdGVuUm1NRTkzRWd0cVprdG1VR1o1U2xKa2F4b1Q2cWpkdVFFTkNndHFaa3RtVUdaNVNsSmtheUFCTUFBJTNEMAGCAQYIBBgCIACIAQGgAZirmIz06_4CqAEAsgEA

Had the following stats: image

You can see it took 20 seconds to resolve. I also noticed some weird service worker activity taking place right before this outbound call was made (these are requests in sequential order; first made ones towards top). image

So https://www.youtube.com/live_chat?continuation was hit- seems it failed. Then (the gear icon) the service worker is also red. Those both are marked as Stalled. The service worker one has 1.8 minutes as the run time. image

@pes10k could anything about our service workers (any deviations we have from Chromium) cause this?

snowbound commented 1 year ago

I can say that this is happening across all 3 of Brave builds, release, beta and nightly more than 1 out of 10 times for me during regular viewing of the live streams with chats. It is rare for me to have a chat load properly. Today from 4 different live chats 3 out of 4 failed.

I have found that repeatedly force reloading the stream will cause the issue to occur. Also pausing the stream and then force reloading the stream can also duplicate the issue. I am not the only end-user seeing this issue. Something happened back in early Sept 2022 that caused this issue to occur.

bsclifton commented 1 year ago

@snowbound repeatedly force reloading is consistent with what I'm seeing. Although, I get good results when opening dev tools (F12) and checking the box Disable cache (should be at the top of the dev tools). With the dev tools open, I can only reproduce the issue when this box is unchecked. image

With that checked, I'm curious if you can reproduce the issue. You can try reloading the page and dev tools will stay open. Let me know

snowbound commented 1 year ago

@bsclifton I have over the past 8 months tried disabling the cache several times and that did not solve the issue. I can not remember if I had Dev tools open on each instance. I have Nightly installed and I can not find that option.

Update I finally found the setting whose location changed in Dev Tools compared to Beta when I used it last. Will try disabling cache w Dev tools open and see if that provides any relief.

bsclifton commented 1 year ago

@snowbound awesome - let us know if keeping dev tools open and then having Disable cache fixes the issue for you every time.

This isn't the proper solution of course - but if that works 100% of the time, it does help narrow the problem down for us. With that enabled, I gave up after reloading the page about 50 times because it worked each time.

snowbound commented 1 year ago

@bsclifton After 2 days of getting notifications and rather than clicking on the notification, I went to my YT subscriptions page and did a F12 and only then clicked on a Livestream the chats all loaded promptly.

Another end user on the Brave subreddit back in Nov or Dec 2022 mentioned disabling the cache but they said it did not always work. I tried it at that time but did not at the time realize that the Dev window had to be open for the disabled cache to be active

snowbound commented 1 year ago

@bsclifton It appears that using F12 Developers console and disabling cache no longer works to allow the live YT chat to populate properly. I guess it is fitting on the one year "celebration of this bug.

cyfung1031 commented 10 months ago

@snowbound @bsclifton Here is an unofficial solution - https://greasyfork.org/en/scripts/474214-fix-brave-bug-for-youtube-live-chat Also See https://community.brave.com/t/youtube-live-chat-30-sec-delay/432842

There is an issue for Brave to load the iframe content and the url will become about:blank with an empty body. YouTube modifies the DOM element creation and Brave injects scriptlets (no disable option in Brave) for every webpage including iframe content. I believe it is due to the conflict with iframe creation and scriptlet injection. For example, the scriptlet runs some coding which is not allowed at the initial stage so the iframe content loading is stopped.

The 30s is set by YouTube's engine. YouTube can detect if the content is not displayed then refresh the iframe. This is not implemented by Brave.

snowbound commented 10 months ago

@cyfung1031 Yes I am the original poster for that Brave Community thread and have been using that thread which you fixed earlier this week. There is also another issue with Brave in live YT chats blanking out the posting area in the chat

cyfung1031 commented 4 months ago

@bsclifton @lukemulks @snowbound @ryanbr @Brave-Matt @rebron

The root cause is identified. Now wait for someone to update the Brave core.

Root Cause

YouTube calls "urlChanged" twice to set the iframe url. In the first attempt, chatframe.contentDocument is null. So it will set the src of the iframe. In the second attempt, chatframe.contentDocument is non-null. So it will set the url using chatframe.contentDocument.location.replace

Both Brave and Chrome will do these two attempts. Both attempts are just 10ms aparted.

The difference is, in brave, the first attempt affected the second attempt, but in chrome, the first attempt would not affect the second attempt.

It is proven by using Userscript to by-pass the first attempt (i.e. chatframe.contentDocument === null case )

For details, see below.

Details

Please narrow down to the function "urlChanged" in the youtube's polymer script

Screen Shot 2024-05-27 at 20 58 45

When YouTube makes the chatroom iframe, it will call this function to "set" the url. the "src" setter is just the fallback. Basically it uses contentDocument.location.replace to set the url.

I cannot really find the root clause why Brave performs differently from Chrome, but if this function is delayed, the contentDocument.location.replace can be executed correctly.

(The 30s is just a fallback checking by the youtube coding to try location replace again)


In chrome, there would be two attempts. First attempt is that contentDocument is null. Second attempt is that contentDocument.location.replace can be called.

In brave, there are also two attempts. First attempt is that contentDocument is null. Second attempt is that contentDocument.location.replace can be called. (but it failed) I guess the src change in the first attempt might affect the second attempt. ( two attempts are apart from each other within 10ms)


You can use this userscript to test

// ==UserScript==
// @name         Test Brave Bug for YouTube Live Chat
// @namespace    UserScripts
// @version      0.1
// @description  To Test Brave Bug for YouTube Live Chat
// @match        https://www.youtube.com/*
// @grant        none
// @run-at       document-start
// @unwrap
// @inject-into  page
// ==/UserScript==

(() => {

    const insp = o => o ? (o.polymerController || o.inst || o || 0) : (o || 0);

    (async () => {
        'use strict';

        await customElements.whenDefined('ytd-live-chat-frame');

        const chat = document.createElement('ytd-live-chat-frame');

        if (!chat || chat.is !== 'ytd-live-chat-frame') return;

        const cnt = insp(chat);
        const cProto = cnt.constructor.prototype || 0;

        const urlChanged = cProto.urlChanged;
        cProto.urlChanged = function () {
            const iframe = this.chatframe || (this.$ || 0).chatframe || 0;
            if (iframe) {
                try {
                    console.log('iframe.contentDocument', iframe.contentDocument)
                } catch (e) { }
            }
            return urlChanged.apply(this, arguments);
        }

    })();
})();
Screen Shot 2024-05-27 at 21 09 56

Script to verify

The root cause is identified.

If the first attempt is ignored, only the second attempt (i.e. location.replace) is allowed, then the issue is resolved.

( the following script added if(iframe.contentDocument === null) return; after console.log )

// ==UserScript==
// @name         Test Brave Bug for YouTube Live Chat
// @namespace    UserScripts
// @version      0.1
// @description  To Test Brave Bug for YouTube Live Chat
// @match        https://www.youtube.com/*
// @grant        none
// @run-at       document-start
// @unwrap
// @inject-into  page
// ==/UserScript==

(() => {

    const insp = o => o ? (o.polymerController || o.inst || o || 0) : (o || 0);

    (async () => {
        'use strict';

        await customElements.whenDefined('ytd-live-chat-frame');

        const chat = document.createElement('ytd-live-chat-frame');

        if (!chat || chat.is !== 'ytd-live-chat-frame') return;

        const cnt = insp(chat);
        const cProto = cnt.constructor.prototype || 0;

        const urlChanged = cProto.urlChanged;
        cProto.urlChanged = function () {
            const iframe = this.chatframe || (this.$ || 0).chatframe || 0;
            if (iframe) {
                try {
                    console.log('iframe.contentDocument', iframe.contentDocument)
                    if(iframe.contentDocument === null) return;
                } catch (e) { }
            }
            return urlChanged.apply(this, arguments);
        }

    })();
})();
ryanbr commented 2 months ago

I checked the grease monkey script; Streaming Lofi Girl + chat

https://github.com/brave/brave-browser/releases/tag/v1.39.68  BAD
https://github.com/brave/brave-browser/releases/tag/v1.30.29  BAD
https://github.com/brave/brave-browser/releases/tag/v1.21.28  BAD
https://github.com/brave/brave-browser/releases/tag/v1.19.36  BAD
https://github.com/brave/brave-browser/releases/tag/v1.16.15  BAD
https://github.com/brave/brave-browser/releases/tag/v1.11.17  BAD
https://github.com/brave/brave-browser/releases/tag/v1.6.40   Error installing build

With shields off And using violent monkey snapshot + script suggested in GH ticket

Also confirmed its happening in Ungoogled Chromium. So I strongly suspect both Brave and Ungoogled have patchout or disabled something YT uses. ungoogled-chrome-yt

szilardszaloki commented 2 months ago

Thanks for digging into this @cyfung1031! The root cause is not really urlChanged being called twice — there's nothing wrong with that per se. The problem is that upon accessing https://www.youtube.com/live_chat?continuation=... (i.e. the live chat itself) for the first time, the browser doesn't get a response. This request might error out later, but from an HTTP cache perspective, it never fails (as if the request was left around in the network stack). The HTTP cache, however, has a readers-writer lock, which this request acquires, and therefore the second request that attempts to download the live chat can't acquire it (since it's already being held by the first one), hence it hits the 20-sec ERR_CACHE_LOCK_TIMEOUT — which is exactly the delay you guys are experiencing. There's also a race condition involved in the above, which makes it even more tricky to diagnose. I'll report back once I know more.

szilardszaloki commented 2 months ago

Identified the actual root cause — working on a fix.

bsclifton commented 2 months ago

Happy to report the fix from @szilardszaloki works nicely 😄 We're doing a privacy/security review for this feature - so working through that.

In the meantime - I'm curious: does this issue happen on Android too? I don't see the chat when I try to view YouTube.com on Android. But maybe it shows if you have a tablet? If anyone here experiencing this has had the problem on Android please let us know. The fix should work there too

ShivanKaul commented 2 months ago

We'll be adding back the Client Hints mentioned in https://github.com/brave/brave-core/pull/24763 to fix this webcompat issue since we expose similar information via the JS API (also for webcompat reasons) but will be reducing the information leaked via fullVersionList like we did for the JS API: https://github.com/brave/brave-browser/issues/23491.

szilardszaloki commented 2 months ago

@snowbound @ScrapBlox @cyfung1031 Heads-up — fix is in Nightly.

snowbound commented 2 months ago

I am only on the release cycle, so I will have to wait until it percolates. Thanks for fixing this issue.

kjozwiak commented 2 months ago

The above requires 1.69.137 or higher for 1.69.x verification 👍 @brave/qa-team adding the QA/Test-All-Platforms label as it will be a good idea to get this verified on the various platforms to ensure there's no obvious issues/regressions. Can use https://github.com/brave/brave-core/pull/24763#issuecomment-2271589775 as the template for verification.

MadhaviSeelam commented 1 month ago

Verification PASSED using

Brave | 1.69.137 Chromium: 127.0.6533.100 (Official Build) beta (64-bit)
-- | --
Revision | 40b6ccbd1eb76c8f575e83de8ad81c4349d3f32a
OS | Windows 11 Version 23H2 (Build 22631.3958)

Reproduced the issue in 1.68.137 Chromium: 127.0.6533.100 using the STR/Cases outlined via https://github.com/brave/brave-core/pull/24763#issue-2419942793 with https://www.youtube.com/watch?v=_uMuuHk_KkQ where the Live Chat wasn't loading due to https://www.youtube.com/live_chat?continuation=... hanging/being in a Pending state as per the following:

https://github.com/user-attachments/assets/dfd01b7d-dcd8-4f1f-ac9e-5e7496553540

Verified the in 1.69.137 Chromium: 127.0.6533.100 using the same STR/Cases as per the above, verified that the Live Chat was loading pretty quickly as per the following with two live streams where chat was enabled

https://www.youtube.com/watch?v=_uMuuHk_KkQ

https://github.com/user-attachments/assets/15bd29ae-53b2-4836-83c5-9a22724cf698

https://www.youtube.com/watch?v=h9gc-YS4K-E

https://github.com/user-attachments/assets/8c316d90-e265-4ee0-9926-84035eb0e093

stephendonner commented 1 month ago

Verification PASSED using

Brave | 1.69.137 Chromium: 127.0.6533.100 (Official Build) beta (x86_64)
-- | --
Revision | 40b6ccbd1eb76c8f575e83de8ad81c4349d3f32a
OS | macOS Version 11.7.10 (Build 20G1427)

First, reproduced using 1.68.137:

Screen Shot 2024-08-07 at 4 51 43 PM

Then, reproduced the fix using 1.69.137:

example example
Screen Shot 2024-08-07 at 5 02 33 PM Screen Shot 2024-08-07 at 5 06 48 PM
stephendonner commented 1 month ago

Verified PASSED using

Brave   1.69.138 Chromium: 127.0.6533.100 (Official Build) beta (64-bit) 
Revision    2569cce791e23282c250db59de277f2e81c33d9b
OS  Linux

Verified the in 1.69.137 Chromium: 127.0.6533.100 using the same STR/Cases as per the above, verified that the Live Chat was loading pretty quickly as per the following with two live streams where chat was enabled

confirmed that the video/audio loaded instantly without any issues/ads confirmed that the Live Chat loaded instantly without any issues/crashes confirmed that https://www.youtube.com/live_chat?continuation=... didn't get stuck in Pending state for ~15-30s.

example example
Screen Shot 2024-08-08 at 12 17 58 PM Screen Shot 2024-08-08 at 12 18 25 PM