simonlindholm/toggle-gifs

Blacklist/Whitelist For Websites

Closed this issue · 11 comments

It'd be great to have a blacklist mode which stops .gifs (until clicked) on sites on the blacklist and a whitelist mode which stops .gifs (until clicked) on sites not on the whitelist, with only one mode selectable at a time.

Sounds okay (although it would by necessity have #2 reoccur on the listed sites). Is this UI clear, do you think?
skrmbild frn 2014-05-18 16 11 54
(It's somewhat hard to explain input formats etc. to users with only a single sentence, and to know what flexibility to allow.)

Also, just wondering, what sort of sites would you find this useful for?

The UI is clear but If there can be only a blacklist or a whitelist I'd rather have a blacklist.

Something like this:
Pause GIFs by default ☑
Pause GIFs by default only on these sites (e.g. example.com, example.net) ☑: ________

or with both if possible:
Pause GIFs by default except on these sites (e.g. example.com, example.net) ☑: ________
Pause GIFs by default only on these sites (e.g. example.com, example.net) ☑: ________

If one can't be made unselectable when the other is checked then when both are checked "Pause GIFs by default" would take priority.

I'd mainly use it to blacklist tumblr, Sankaku Complex, and a couple forums that are GIF heavy.

Hm, the option was meant to work as both whitelist and blacklist, depending on whether "Pause GIFs by default" was checked or not... Wording is hard. Maybe get rid of the "…" and say "– override that setting for these sites" instead? Other suggestions?

skrmbild frn 2014-05-18 18 18 15

I'd mainly use it to blacklist tumblr, Sankaku Complex, and a couple forums that are GIF heavy.

Thanks, that's useful to know. (Tumblr would hit #2, I'll see if I can hack around it.)

I think "override the above setting for these sites" would be better with a note in the addon description like "When Pause GIFs by default is checked the override acts as a whitelist, autorunning GIFs only on the specified sites. When unchecked it acts as a blacklist, autorunning GIFs on all sites except those specified."

Sounds fair. If you want to try the feature out and give feedback before I get around to making a release, I've uploaded an XPI at http://simonsoftware.se/temp/toggle-gifs-blacklist.xpi (mirrors the 'wip' branch).

Works great, thanks! Only feedback I have is that it'd be nice to have an icon or border around the paused GIFs.

That's a harder problem than it sounds, actually. The addon can only check for GIF animation manually, one image at a time (which currently happens on hover), so showing an icon/border would require looping through all images to check for GIFness, slightly slowing down every single page load (in case "Pause GIFs by default" is set, at least). For correctness it would also have to be done continuously, since a GIF can gain animatedness status as it loads, and images can appear dynamically. It might also be that just querying whether an image is animated makes Firefox decode it, consuming additional CPU and memory... The "pause by default" flags don't encounter that problem, because they can just set a flag on the page which Firefox uses to determine animation mode.

I might try to add something like that at some point as an experimental option, because there have been some people asking for it, but I'm rather hesitant to add things that slow down browsing, and it's also a bit hard technically.

Wow, didn't know it would be so complicated. Honestly I'd settle for an icon or border on every GIF, animated or not. Don't see many non-animated GIFs these days with the prevalence of JPEG and PNG.

Doing that properly would be just as hard, and it would also hit various small icons... You could try adding img[src*='.gif']:not([src*=icon]) { border: 1px dashed #b85; } or similar to your userContent.css, though.

That works okay, thanks.
Some sites have small images everywhere that get bordered but I can just set the style for a few sites.

I went with "that setting" after all, since "the above" sounds really weird to me given the "– " in front. I also moved the "Disable GIFs by default" setting to the top, though, so that should make it clearer. Will update addon description as soon as it's reviewed.