You can probably do it with Greasemonkey, have you tried that yet?
Firefox
A community for discussion about Mozilla Firefox.
Are there any Greasemonkey scripts to add GIF playback controls?
When viewing a gif (say https://i.imgur.com/l53kRnm.gifv) you can right click it and select "Show Controls".
that isn't strictly speaking a gif. imgur (among other image/video/etc hosting) can do a lot of tricks. that ".gifv" at the end of the url makes it present the "gif" as a video (mp4, in this case).
If you change the url to end with just ".gif", then it'll show it as an actual gif
I had tried this on Reddit and it worked ... only to find out that it actually shows GIFs as videos, with URLs like this: https://preview.redd.it/ni50mhcst4eb1.gif?format=mp4&s=258d02a4fde68d53272c8d6a08f2ba648dfd2111. I tried it on this actual GIF but it's not available https://www.google.com/search?client=firefox-b-1-d&q=web+gif+example#vhid=YGtfdlLW95ObWM&vssid=l.
That's not a GIF, that's gifv, a format from Imgur to show videos as GIFs. It doesn't work when I try it on an actual GIF: https://www.google.com/search?client=firefox-b-1-d&q=web+gif+example#vhid=YGtfdlLW95ObWM&vssid=l.