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

Youtube theater mode not working on browser opening #29591

Closed
jincastillo992 opened this issue Apr 9, 2023 · 42 comments
Closed

Youtube theater mode not working on browser opening #29591

jincastillo992 opened this issue Apr 9, 2023 · 42 comments

Comments

@jincastillo992
Copy link

jincastillo992 commented Apr 9, 2023

Description

When I open the browser app, the videos in youtube don't start in theater mode. This has being happening for about a week

Steps to Reproduce

  1. Open browser
  2. Go to youtube
  3. Open any video

Actual result:

image

Expected result:

image

Reproduces how often:

Always

Brave version (brave://version info)

Brave | 1.50.114 Chromium: 112.0.5615.49 (Build oficial) (64 bits)
Revisión | bd2a7bcb881c11e8cfe3078709382934e3916914-refs/branch-heads/5615@{#936}
Sistema operativo | Windows 11 Version 22H2 (Build 22621.1413)

Version/Channel Information:

  • Can you reproduce this issue with the current release?
  • Can you reproduce this issue with the beta channel?
  • Can you reproduce this issue with the nightly channel?

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields? No
  • Does the issue resolve itself when disabling Brave Rewards? No
  • Is the issue reproducible on the latest version of Chrome? No

Miscellaneous Information:

@rebron
Copy link
Collaborator

rebron commented Apr 10, 2023

@jincastillo992 Is there a setting in Youtube that allows you to start/view youtube videos in theatre mode? What you see in actual result is the default view.

@nathanpete1
Copy link

Does the expected result occur on other web browsers?
If I were to guess, the status of what viewing mode you are using is not saved in cookies, and resets to default when launching the webpage from a fresh browser session

@jincastillo992
Copy link
Author

jincastillo992 commented Apr 10, 2023

@jincastillo992 Is there a setting in Youtube that allows you to start/view youtube videos in theatre mode? What you see in actual result is the default view.

I have not touched any youtube settings. Yes, in the actual result is the default view, but, for example, in Chrome if you have a video playing in theater mode and you close the browser and open it again, the videos should play in theater mode

Does the expected result occur on other web browsers? If I were to guess, the status of what viewing mode you are using is not saved in cookies, and resets to default when launching the webpage from a fresh browser session

I have Chrome installed and this doesn't happen there. I haven't touched any Brave settings or anything, I even reinstalled Brave this weekend thinking that may solve the problem, but no success.

@Vanerio
Copy link

Vanerio commented Apr 12, 2023

The exact same thing has been happening to me for about a week, as you said.

@ErebusAres
Copy link

same issue, no settings changed, i dont think youtube even has optional settings anyway.

@RixzZ
Copy link

RixzZ commented Apr 14, 2023

Same here, but I noticed also other changes on other websites. It's like if Brave was clearing some data on exit that it didn't clear before.

@IkaOverride
Copy link

I have the same issue

@d4kir92
Copy link

d4kir92 commented Apr 25, 2023

same problem

on edge for example it is working (saved the theater mode)

@sol3uk
Copy link

sol3uk commented May 2, 2023

I've noticed this too and it's bugging me. Happy to help investigate if required.
Running : Version 1.50.121 Chromium: 112.0.5615.138 (Official Build) (64-bit)

@d4kir92
Copy link

d4kir92 commented May 2, 2023

found a workaround till its fixed!

go to youtube, hit F12, go to console and put this in
document.cookie = 'wide=1; expires='+new Date('3099').toUTCString()+'; path=/';

press enter

now the cookie expires in year 3099

after restart brave the theater mode works normally, so it must be something with the cookies

@sol3uk
Copy link

sol3uk commented May 2, 2023

Well yeah I mean that sorts it but doesn't explain if youtube has changed their cookie expiry or if brave released a change to how it treats the end of a "session" in which case it should be affecting more than just youtube.
image

@d4kir92
Copy link

d4kir92 commented May 2, 2023

well it works in edge, chrome for me, but brave it is not working, strange :D

@d4kir92
Copy link

d4kir92 commented May 2, 2023

I also lose some cookies on other websites with Brave
(i need to reaccept cookies sometimes)
on youtube i only lose the "wide" cookie

@IkaOverride
Copy link

IkaOverride commented May 2, 2023

Thanks for the workaround. And I can confirm I lost cookies on some websites a few days ago without clearing cookies, and one of them was youtube iirc (can't remember the others though)

@Itchetiky
Copy link

Itchetiky commented May 3, 2023

found a workaround till its fixed!

go to youtube, hit F12, go to console and put this in
document.cookie = 'wide=1; expires='+new Date('3099').toUTCString()+'; path=/';

press enter

now the cookie expires in year 3099

after restart brave the theater mode works normally, so it must be something with the cookies

This workaround also worked for me.

Brave Version 1.50.121 Chromium: 112.0.5615.138 (Official Build) (64-bit)]

@d4kir92
Copy link

d4kir92 commented May 9, 2023

k somehow that cookie got deleted, wtf

@d4kir92
Copy link

d4kir92 commented May 17, 2023

somehow the cookie only is alive 1 week, any fixes or ideas when this get fixed?

i also get cookie banners on sites where i am logged in and already accepted

brave settings for cookies on leave is nothing checked and rest of settings is also on default

@d4kir92
Copy link

d4kir92 commented May 24, 2023

so cookies get deleted after 7 days, so i need to manually add the cookie each week, great xD

@d4kir92
Copy link

d4kir92 commented Jun 16, 2023

still having this problem...

@d4kir92
Copy link

d4kir92 commented Jun 27, 2023

still this cookie gets deleted each week and not created automatically, so i need to manually add the cookie to get it working

this is not happening in chrome/edge

@sol3uk
Copy link

sol3uk commented Jun 27, 2023

I'm currently on Version 1.52.126 Chromium: 114.0.5735.133 (Official Build) (64-bit)
And it's working fine for me. Was fine for me since trying the "wide" workaround above and it's remained in the browser since. This was only a youtube issue for me though, it didn't effect other sites like you mentioned above @d4kir92. You might need to look at browser settings around wiping cookies or just try a clean install.

@d4kir92
Copy link

d4kir92 commented Jun 27, 2023

I'm currently on Version 1.52.126 Chromium: 114.0.5735.133 (Official Build) (64-bit) And it's working fine for me. Was fine for me since trying the "wide" workaround above and it's remained in the browser since. This was only a youtube issue for me though, it didn't effect other sites like you mentioned above @d4kir92. You might need to look at browser settings around wiping cookies or just try a clean install.

yes, only youtube has the problem, but still happens each week
other sites are fine now

@Brave-Matt
Copy link

@ShivanKaul
Copy link
Collaborator

ShivanKaul commented Jul 6, 2023

Hi folks, I'm trying to understand this issue. Is the issue that:

  1. Theater mode goes away if you restart the browser? Or,
  2. Theater mode goes away randomly, even if you haven't restarted the browser?

If it's 1: Given that wide is a session cookie (which seems to be how Youtube checks if you want Theater mode), I don't see how it could ever last across a browser restart. Desktop Chrome behaves the exact same way. I see similar comments on Reddit about Chrome: https://www.reddit.com/r/youtube/comments/1063040/youtube_wont_automatically_go_into_theatre_mode/

If it's 2: Brave's 7-day cookie expiry shouldn't apply to session cookies. I just confirmed that this is true and am adding a test for it: brave/brave-core#19171. AFAICT YouTube's theater mode should behave the same on Brave and Chrome (and Edge, and...).

Would love steps to repro the problem such that it happens in Brave and not Chrome.

@goodov
Copy link
Member

goodov commented Jul 6, 2023

@ShivanKaul #28379
we now do cleanup session cookies on browser close.

cc @pes10k

@d4kir92
Copy link

d4kir92 commented Jul 6, 2023

Hi folks, I'm trying to understand this issue. Is the issue that:

  1. Theater mode goes away if you restart the browser? Or,
  2. Theater mode goes away randomly, even if you haven't restarted the browser?

If it's 1: Given that wide is a session cookie (which seems to be how Youtube checks if you want Theater mode), I don't see how it could ever last across a browser restart. Desktop Chrome behaves the exact same way. I see similar comments on Reddit about Chrome: https://www.reddit.com/r/youtube/comments/1063040/youtube_wont_automatically_go_into_theatre_mode/

If it's 2: Brave's 7-day cookie expiry shouldn't apply to session cookies. I just confirmed that this is true and am adding a test for it: brave/brave-core#19171. AFAICT YouTube's theater mode should behave the same on Brave and Chrome (and Edge, and...).

Would love steps to repro the problem such that it happens in Brave and not Chrome.

  1. yes
  2. not randomly

if i normally use youtube, if i set theatermode on it makes a wide cookie and if i restart its gone, but not on chrome/edge/...
if i manually add the wide cookie it stays 7 days

the link you sent says that it only happen when i am logged in, i am only logged in in brave

@Volodesi
Copy link

Volodesi commented Jul 6, 2023

Same issue. Every time Brave is restarted. It forgets to stay in Theater mode. I don't clear or reset anything when closing/opening Brave.

Edge and Firefox on the same system having no issues with Theater mode staying between restarts.

@ShivanKaul
Copy link
Collaborator

ShivanKaul commented Jul 6, 2023

Quick update here: the issue is that Chrome DOES persist session cookies across browser restarts if you have Continue where you left off setting on, which is not how session cookies are supposed to behave. We're looking into it.

if i manually add the wide cookie it stays 7 days

How are you manually adding it?

@d4kir92
Copy link

d4kir92 commented Jul 6, 2023

go to youtube, hit F12, go to console and put this in
document.cookie = 'wide=1; expires='+new Date('3099').toUTCString()+'; path=/';

that only last 7 days, sadly

pes10k added a commit to brave/adblock-resources that referenced this issue Jul 6, 2023
adds a scriptlet to mirror the session cookie value in localstorage
@ShivanKaul
Copy link
Collaborator

document.cookie = 'wide=1; expires='+new Date('3099').toUTCString()+'; path=/';

Right, this will last only 7 days because you're specifying the expires and we cap the maximum expires on cookies set via JS.

@d4kir92
Copy link

d4kir92 commented Jul 6, 2023

So we can make a Cookie without expires?

@ShivanKaul
Copy link
Collaborator

We're introducing a fix for YouTube to let the wide session cookie persist beyond a browser restart.

@d4kir92
Copy link

d4kir92 commented Jul 17, 2023

it still happening

@ShivanKaul
Copy link
Collaborator

ShivanKaul commented Jul 17, 2023

@d4kir92 could you give a video recording of the issue?
Could you also check what's the version of your Brave Ad Block Updater component? You can see that by going to brave://components and looking for Brave Ad Block Updater. Mine is 1.0.372.

@d4kir92
Copy link

d4kir92 commented Jul 17, 2023

Brave Ad Block Updater - Version: 1.0.372

@d4kir92
Copy link

d4kir92 commented Jul 17, 2023

@ShivanKaul
Copy link
Collaborator

Ok, can you confirm that you've removed any wide cookies that you manually added?

@d4kir92
Copy link

d4kir92 commented Jul 17, 2023

well yes, it get deleted everytime i close the browser

@ShivanKaul
Copy link
Collaborator

If you manually added a cookie like you said you did in #29591 (comment), that would not get deleted when you close the browser.

@d4kir92
Copy link

d4kir92 commented Jul 17, 2023

i didnt added the cookie the last 10 days or so, i also removed the one that get created by youtube and tested, same result

@d4kir92
Copy link

d4kir92 commented Jul 17, 2023

image

@ShivanKaul
Copy link
Collaborator

Just to follow-up here, we discussed this at https://community.brave.com/t/problem-youtube-cookie-gets-deleted-each-week-also-other-sites/489465/30. Please be sure to have Brave Shields ON, otherwise our fix won't work.

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

No branches or pull requests