TwitchAdSolutions
TwitchAdSolutions copied to clipboard
Configuration for vaft userscript?
Hey there,
I just saw the recent update to the vaft userscript, and as we discussed before, being able to configure the new proxy settings is probably a good idea for the end user.
Would it be possible to create a way to configure the userscript version? I prefer it to get fixes quicker and easier than waiting for extension store updates. As far as I can tell, the extension settings are currently pulling from localStorage somewhere, however I can't see the userscript doing this with the user configurable options. It may also be an idea to use GM_getValue if using localStorage on Twitch itself is unfavourable, with a user guide for setting values.
Thanks, Elliott
~~So at the moment it's hard coded to point to TTV LOL.~~ (EDIT: It's now disabled). Honestly I think the easiest thing would be to just edit the code.
https://github.com/pixeltris/TwitchAdSolutions/blob/05c13983eb15c966810d93473a96c28aefc7aea0/vaft/vaft.user.js#L85-L87
You can ignore that second value. But the first and third control the proxy. Set it to null to avoid using the proxy. For the proxy quality set the third value to something like scope.DefaultProxyQuality = '720p'.
And for anyone who reads this who is using uBlock Origin you can fork the code, make the change, push it to your fork and grab the url for your fork.
That being said if you really wanted to make it configurable you'd need to add a button to somewhere on the page, create a popup UI, save to/from localStorage, and assign the relevant values. You could do that and make a PR to VideoAdBlockForTwitch repo or insert the changes as part of the vaft build process in utils.cs (which is how I inserted TTV LOL, I just didn't commit the code as my file is a mess). Unfortunately I don't have any plans to work on this myself but if you need any further guidance I'm sure I could help.
And just to clarify where the settings come from in the extension version see:
There wont be a good way to reuse those as-is but you could convert the html to js DOM appends and the directly set TwitchAdblockSettings or the default values.
Considering the userscript is more likely to be used by more advanced users, it could be feasible to // @grant GM_getValue and then have DefaultProxyType be set to GM_getValue('proxyTTV', 'TTV LOL') (with something similar for quality), then tell users how to set those values themselves using their userscript manager.
If that seems like an alright idea I could make a PR later, lemme know.
Sure. The script is pulled directly from the other repo so changes would need to be made there or to the utils.cs which is where the userscript header and such are inserted.
I had a little play around with the GM_getValue thing but it doesn't look like it shows any visual setting for it? It just tells you there is data stored by the script. At least for tampermoney anyway.
EDIT: There should be a "Storage" tab which isn't showing up for me for whatever reason. Probably just a setting I'm missing, not important.
On Violentmonkey, it shows up like this:

I've changed the code to disable it by default. TTV LOL is down and it also should be opt-in as you've mentioned. I'd generally advise to use the extension for the configuration options.