Youtube HD

Select a youtube resolution and resize the player.

< 脚本Youtube HD的反馈

评价:一般 - 脚本能用,但还有一些问题

§
发表于:2023-10-27

Code keeps resetting itself to 1080p, even though I set it for 1440p.
It works for a day or two, then it's 1080p again, so I constantly have to change it back.

adisib作者
§
发表于:2023-10-27

There have been several updates lately over the past couple weeks to fix some issues. It was requested by other users several times to save the previous value instead of using what is coded in the script so that people do not have to change their settings after every update. That settings storage has been implemented now and you can make it update by setting "overwriteStoredSettings: true" within the settings. It will store the settings that were configured when the script was first run or the last time overwriteStoredSettings was set to true. So if you set it to true, load a video on youtube so it gets applied, and then set it to false again to lock it, you should never lose your settings again.

§
发表于:2023-11-10

Is it really necessary to change overwriteStoredSettings back to false after you change the settings and set it to true? Seems like the settings will remain in the script until the script is updated, and the updated script will already have that set to false. So doesn't seem like it should be necessary.

§
发表于:2023-11-10

Just saw that you are saving the setting for overwriteStoredSettings in settings storage, seems like that setting should not be saved.

The reason is if it is saved, then when the script is updated, the settings in the script itself will all be set to whatever is the default in the script, yet the overwriteStoredSettings will actually be set to the value in settings storage, which would logically mean it will overwrite all settings with the defaults again.

It may not actually work this way, but it seems to me that the better option would be to not store that setting in settings storage and let it reset back to "false" when the script is updated. That way the other stored settings will remain in effect (even though the script settings are different) and there is no chance any of those script settings will overwrite saved storage unless the user manually sets overwriteStoredSettings to true.

§
发表于:2023-11-10

I forgot to mention in the second paragraph in my last post, that only if the user leaves overwriteStoredSettings set to "true" will it have the effect of resetting all settings back to default. It is not intuitive for this to happen, so I think that setting just shouldn't be saved at all, and it should always revert to "false" when the script is updated.

adisib作者
§
发表于:2023-11-11

Yes, you are right. Someone may want it to be perpetually enabled to overwrite so that they have the same behavior as before the settings storage was implemented. Maybe they have a use case where they may want to periodically change settings rather than it being a one time configuration. But obviously needing to change just the overwrite setting after every update for some niche users isn't as bad as the settings storage being completely broken for everyone. Again, I didn't give the change the attention I should have in my limited time, apologies.

I will have that option excluded from the settings storage in the next update.

§
发表于:2023-11-15

I also just recently found out about https://github.com/sizzlemctwizzle/GM_config/wiki which allows you to pop-up a settings menu from within the *monkey (Greasemonkey, Tampermonkey, Violentmonkey, etc.) menu and save the results in the script value storage. This way you don't have to edit the script at all.

It uses the GM_registerMenuCommand to register a menu item in the *monkey menu that pops up the config GUI. You can also just add toggles directory to the *monkey menu using GM_registerMenuCommand. For instance like the "Youtube Classic" userscript does.

§
发表于:2023-11-15

I tried another userscript that uses GM_config with Violentmonkey and it appears that it doesn't work with it for some reason, so maybe not the best option, unless there is just something wrong with my setup or this particular script. GM_registerMenuCommand works fine with "Youtube Classic" however so that is not the problem.

§
发表于:2023-11-15

I figured out the problem with GM_config and Violentmonkey. The particular userscript I was using was acting on the chat window of a Live Youtube and that chat is in a separate frame.

Violentmonkey apparently doesn't like that and doesn't display the GM_registerMenuCommand when on the Youtube page displaying both the video and chat, but if you open the chat by itself in a separate tab, the Violentmonkey menu then has the item added to the Violentmonkey menu by the GM_registerMenuCommand. So i assume this issue would not affect your userscript and it might work, although I do have one other strange issue in that I get a 429 error regarding loading the GM_config.js file every time I update the script, even though it does appear to actually download the file and install it.

发表回复

登录以发表回复。