tweaks redgifs embed/iframe video
< Feedback on Redgifs Embed Tweaks (RET)
Hey, thanks for the feedback! I sincerely appreciate your suggestions.
Regarding modifying the downloadAsBlob
function, I can add another button to open the direct link instead of downloading. However, adding another layer to complete the download seems a bit annoying for some users. That’s exactly why I included this:
if (!isRootWindow) {
return unsafeWindow.parent.postMessage({ redgifsURL: vUrl }, "*");
}
This way, the downloads are processed under the Redgifs domain, avoiding CSP and other permission errors set in the headers of some pages.
Also, about the script generated with help the ChatGPT, I will add the threshold: 0.85, as I think it fits better. However, regarding the other ideas, they seem a bit specific, and most people might not adapt to them.
As for the delay, I think most users of the script might find it a bit annoying if the video takes too long to load, even if it's just a little. It would create behavior different from the browser's native experience. Regarding currentTime, I don't understand its purpose.
But if you like, you can send the URL of the userscript on GreasyFork, so I can add the userscript that smooths the video to the README of the userscript.
Here's my script https://greasyfork.org/en/scripts/553342-redgifs-cpu-saver and placing "currentTime = 0" right after the video.pause will reset the paused videos play duration back to 0:00:00. My script actually does this and it pairs well with your script. I just turned off the 2 features on yours. Just thought it couldn't hurt to add that one QoL change to yours.
"currentTime = 0" right after the video.pause will reset the paused videos play duration back to 0:00:00
Yes, I know, but I can't see in what situation this could be useful in the userscript user flow.
My script actually does this and it pairs well with your script.
That’s nice! I will add that to the README.
I just turned off the 2 features on yours. Just thought it couldn't hurt to add that one QoL change to yours.
I can add a toggle option to enable the smooth feature, but as a default, it may not work for most people.
Anyways, I really appreciate your feedback. I'm just thinking about how most people will use the script.
You're welcome and alright thanks :D
I highly suggest replacing your "async function downloadAsBlob(vUrl, downloadElementEntry)" section with the following: https://pastebin.com/b7YK4HzK I suggest this so the blob menu will open a new tab upon clicking on your desired download format option. In short, this is so the script doesn't overwrite the current tab's url or anything. It also avoids that 404 access denied webpage too.
Also fun fact with help from ChatGPT I more or less combined what your Play 1 video at a time and Pause what it isn't shown together but refined it into it's own stand alone script. So I found out for videos to be really nice and smooth I suggest make adding a Visible_Threshold at "0.85" and put a "DELAY" of like 550 for on the paused videos to start as you scroll. I added a fade in style of 0.6s - Oh and tossing in a "currentTime = 0" on the paused videos couldn't hurt.