Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper RedGIFs Sound Controls with Userscript #168

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

omegasome
Copy link
Contributor

  • Made embedit.redGifConvert automatically add #sound fragment when sound is on. No effect on users not using the userscript.
  • Extended updateSound method in script.js to post the soundOn/soundOff messages to embedded redgifs iframes when toggled.
    I know I said it exceeded my abilities, but it turned out it did not.

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.

…nd is on. No effect on users not using the userscript.
… messages to embedded redgifs iframes when toggled.
@omegasome
Copy link
Contributor Author

omegasome commented Feb 7, 2024

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 omegasome changed the title Proper RedGIFs Sound Controls with Userscript API Proper RedGIFs Sound Controls with Userscript Feb 7, 2024
@omegasome
Copy link
Contributor Author

omegasome commented Feb 7, 2024

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.

…n off links (the "image" button does the same thing); allowed it to disable looping (for the next thing I'm doing); made it detect if the userscript that does all these things is actually, yknow, installed
… ugly thing to search for them while excluding iframes created by extensions. Should've thought of that in the first place.
…ives the gfy_ended signal. This one makes it disable the auto-next timer when it sees a gfy image AND rp.session.gfy_enhanced_api is set. It skips to next on a timer when typical when the script isn't present, but waits when it is.
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.

1 participant