ctrl-freaks / freezeframe.js

freezeframe.js is a library that pauses animated .gifs and enables them to animate on mouse hover / mouse click / touch event, or with trigger / release functions.
http://ctrl-freaks.github.io/freezeframe.js/
MIT License
1.41k stars 110 forks source link

Userscript/browser addon version of this code #61

Closed XCanG closed 4 years ago

XCanG commented 4 years ago

Hello, is it possible to make it as userscript or browser addon and inject on a pages?

I have a website with annoying gifs on it. I can't remove them, since they are not AD, but I want to have a cheaper and less consumed and animated page, so that I can run this script on a page and it will set all gif images to static and animate only when hover on it.

nickforddev commented 4 years ago

it's certainly possible to do this, but not exactly on our project roadmap. I can offer some recommendations on how you could do this:

  1. Use the CDN script, which is the simplest way to get started with Freezeframe: https://github.com/ctrl-freaks/freezeframe.js/tree/master/packages/freezeframe#cdn
  2. Make a userscript that injects the script
  3. Initialize freezeframe on the page using a broad selector, like 'img[src$=".gif"]'.