ynshung / better-yt-shorts

Playback, volume, timestamp controls and more on YouTube Shorts.
GNU General Public License v3.0
240 stars 43 forks source link

Add extra options to disable double click fullscreen #209

Closed ynshung closed 8 months ago

ynshung commented 9 months ago

Closes #207

ynshung commented 9 months ago

@adsuth I have a problem with the implementation: since I set the default extra option as true, the option does not work at all. Disabling it does not affect the local storage's yt-extraopts at YouTube's website but the other options work as expected.

I've checked and see that up till pingChanges the content is correct showing fullScreenDoubleClick: false. Do you have an idea of what might causes this bug?

adsuth commented 9 months ago

Hi @ynshung, I'm not 100% sure, but I think it might be this here (at src/lib/retrieveFromStorage.ts:30):

image

This is only checking if the option in storage is truthy, if it isnt, then it applies the default value.

So setting the new option to false will make it use the default value, true.

This issue doesnt exist for setting false values to false because it just uses the default which is false. (just to clarify because that confused to me when i was looking into this)

Solution is to make this check more explicit, not sure why I commented on it instead of just changing it, maybe there was an issue checking if it was null? Not sure.