Skip to content

Conversation

@bashward
Copy link
Contributor

@bashward bashward commented Oct 9, 2025

This should close #3237

Changes:

  • New setting full_screen_quality
  • Autoselect on fullscreenchange; restore on exit
  • Route through existing quality applier when available
  • Default: full_screen_quality = "auto"
  • i18n: add fullScreenQuality label

@ImprovedTube
Copy link
Member

thank you so much! @bashward
it is enough to add one line to init.js
please compare: #3224 (comment)

@ImprovedTube
Copy link
Member

@bashward
Copy link
Contributor Author

bashward commented Oct 9, 2025

@ImprovedTube kept only one even listener in init js, let me know if you'd like any other changes.

@ImprovedTube
Copy link
Member

hi! @bashward they can stay, sorry, just meant, since we have many features we can make all feature code depend storage
then the the event listener can run only for who needs them.
so in init.js could be only if (ImprovedTube.storage.full_screen_quality && ImprovedTube.storage.full_screen_quality !== 'auto'. ) { evenlisteners... change quality}
so the main function can be modular

sorry ImprovedTube.storage.full_screen_quality !== 'auto' is even required. got to merge 95aeb5d


There is another new feature requiring to react on fullscreen: https://github.com/code-charity/youtube/pull/3141/files , not sure it works. So maybe the listeners should be added in multiple cases after all
|| ImprovedTube.storage.fullscreen_return_button


if (!('full_screen_quality' in ImprovedTube.storage)) {

why? optionally, to allow uses to apply or remove a specific feature without a reload, we can react on the toggle immediately when it is clicked (not required/could be automated)

      if (message.key === "full_screen_quality" )
        { if (!ImprovedTube.storage.full_screen_quality ||  ImprovedTube.storage.full_screen_quality = 'auto';  ) {  //any cleaning?
         else { //any welcome animation? }
             }  
      }  

# Immediate reaction to any change of our extension storage (settings)
While most of our features are chosen permanently (set and forget) and need to run with YouTube,
we only started this section for feedback and reducing new user's misunderstandings.
(For our simple CSS-only features this isn't necessary, since a loop is doing it and there could be a shared loop for many JS feature too)
Yet doing this, it could also be used for big extra visual feedback pointing at or highlighing the immediate change on youtube.
(to make it most intutive to the many new or visual users, bringing changes with simple css-transations or animation. Like an interactive tutorial.)
--------------------------------------------------------------*/
} else if (message.action === 'storage-changed') {
let camelized_key = message.camelizedKey;
ImprovedTube.storage[message.key] = message.value;
if (['block_vp9', 'block_h264', 'block_av1'].includes(message.key)) {
let atlas = { block_vp9: 'vp9|vp09', block_h264: 'avc1', block_av1: 'av01' }
localStorage['it-codec'] = Object.keys(atlas).reduce(function (all, key) {
return ImprovedTube.storage[key] ? ((all ? all + '|' : '') + atlas[key]) : all
}, '');
if (!localStorage['it-codec']) {
localStorage.removeItem('it-codec');
}
}
if (message.key === "player_60fps") {
if (ImprovedTube.storage.player_60fps === false) {
localStorage['it-player30fps'] = true;
} else {
localStorage.removeItem('it-player30fps');
}
}
switch (camelized_key) {
case 'blocklist':
case 'blocklistActivate':
ImprovedTube.blocklistInit();
break

@bashward
Copy link
Contributor Author

Hi! @ImprovedTube, thanks for the explanation. So I'm thinking of adding a helper function in core.js in top level and in the existing storage change dispatcher, call that function kind of like:
if (message.key === 'full_screen_quality' || message.key === 'fullscreen_return_button') {
ImprovedTube.bindFullscreenIfNeeded();
}

This would allow me to make the call in init js minimal and keeps the feature modular like:
ImprovedTube._bindFullscreenIfNeeded(); //in init js

Let me know what you think about this.

@ImprovedTube
Copy link
Member

hi! @bashward,
i mean in init.js, everytime youtube runs, nothing needs to run for all users, the code can be wrapped in
if (ImprovedTube.storage.full_screen_quality) { // call eventlistener & change quality conditionally }


Options / later:

reacting on storage change in core.js: only if we want to react in any way on toggle on or off immediately, which might be convenient, but most users are used to reload the page / are patient enough.)

looking at the other full screen feature

@ImprovedTube ImprovedTube merged commit e18a32a into code-charity:master Oct 26, 2025
1 check passed
"message": "Exclude Shorts when using \"Play all\""
},
"fullScreenQuality": {
"message": "Fullscreen quality"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Successfully merging this pull request may close these issues.

💡Separate quality setting for full screen

3 participants