ubershmekel / redditp

Convert any reddit page to a presentation or slide show
https://redditp.com
MIT License
259 stars 101 forks source link

Proper RedGIFs Sound Controls with Userscript #168

Open omegasome opened 5 months ago

omegasome commented 5 months ago

I have made a userscript, which works with ViolentMonkey on Firefox (likely works on some other configurations, but does not work with Greasemonkey on Firefox), which provides a teeny tiny little API to allow sites to control RedGIFs embeds for users via URL manipulation and/or message passing.

The main purpose of this is to allow the sound checkbox to actually affect embedded redgifs images. This is beneficial to many users, such as users with disabilities who may have a hard time manipulating the mouse to enable sound for each individual image.

Users who do not have the script installed will notice no difference. Users who do have the script installed should have a seamless experience.

This should work so long as RedGIFs does not maliciously block it from working.

omegasome commented 5 months ago

Closes #167

Well not technically, but it seems that unless redgifs decides to natively permit this little API (it's an API, right?) this is the closest we'll get.

omegasome commented 5 months ago

I realize that a change that only affects users who have an unrelated nonstandard script installed is maybe a bit of a hard sell, which is why I went so far as to implement it myself.

It might be good to figure out some way to notify the user that they could enhance their experience using this script. Perhaps toastr.info('For an improved experience with RedGIFs, install <a href="https://greasyfork.org/en/scripts/486812-redgifs-iframe-sound-helper">RedGIFs iframe Sound Helper</a> under <a href="...">ViolentMonkey</a>') the first time they view a RedGIFs image? Could get annoying but arguably not as annoying as having to manually enable sound every goddamn time

However, even without that, this will still work very well for whatever small number of people use the script.