Thursday, January 20, 2022

Block/Allow Images?

 Recently I got some friendly feedback from "qvim". There were multiple parts to it, but I wanted to highlight one of the suggestions. The desired feature would be to ...

block with click, sometimes it doesn't work and if possible I would like to click on the image with the right button and be able to block or allow. (very important)

Now, I'm actually a bit surprised that I haven't gotten more feedback around this type of request in the past. It's popped up maybe once or twice. There a couple interesting points about this, one technical and one more based on use cases.

 First, the technical reason. For those who haven't peered at the source code, you may be interested to learn that the addon does not actually interact directly with the HTML elements at all. Nope. The filtering actually ties in at a lower level - it is basically processing the network requests for different media types. When I started the project, I thought about taking an approach that would interact with the HTML for each image, but decided against it because I thought working with streams would do a better job of catching every single image going through the system. Several years in, I think I made the right choice but there are still some exceptions - base 64 images and a few others delivered in special ways. However, I don't have to deal endless hacks against the HTML DOM to try to catch every element change or to try to make images invisible until the addon has scanned them.

So why does this matter? Well, it means that once the data has been scanned, I don't have an easy way to know where it actually appears on the page. The image data is essentially read-only. Similarly, I certainly could create something to interact with the images as HTML elements, but there just hasn't been a strong need.

Second, the use cases. Folks like to use this addon in a variety of ways. In some cases, the user is an adult and would like to filter out the junk. But in other cases, parents are using this as a basic defense for their kids. While it's not easy to lock down addons as a parental control, I do try to avoid showing one-click options to see images. There's also a third use case, where the user is an adult but is trying to overcome pornography. In that case, it may also not be the best option to make it too easy to view a blocked image.

So where does that leave things? Well, since the data is already delivered and read-only, it is not technically easy to go back and show an already blocked image (possible, yes, but definitely not trivial). However, hiding an offensive image that the filter missed is easier because it does not require this coordination - for example, the HTML element can just be altered. Similarly, from a use case perspective, it is likely good to allow blocking an image, but not showing one. The easiest way to do something like this would be to expose it as a right-click context menu, but if you follow that link you may notice that the user experience could get a little clunky.

This also ties in with another request: can users report that images are either being blocked incorrectly or that they should be blocked? This one is a bit more spicy to deal with.

I'd like to hear more feedback about if you'd be interested in this blocking feature and/or if you'd be interested in an image reporting feature. Let me know using the feedback link in the addon, or head on over to GitHub!


Update: you can see a rudimentary version of this here: https://github.com/wingman-jr-addon/wingman_jr/tree/hide-images with relevant issue at https://github.com/wingman-jr-addon/wingman_jr/issues/162

Saturday, January 15, 2022

Welcome, Linux Users!

 Recently there was a bump in new users - and the Firefox stats seem to indicate that many of you use Linux. Welcome friends!

Now, I've got a question for you. I don't use Linux desktop as my daily driver, so I need your help in understanding how the performance is looking so far. This addon relies on some level of hardware acceleration ... which hasn't always had the best support on Linux. If you've got a second, I'd love to hear from you over at this poll on Google Forms - can you please help me out?

One last note: if you are finding that the default WebGL backend isn't working well on your machine, it might be worth it to try the WASM backend, which you can pick in the options for the addon.

Hope you enjoy Wingman!

 

Update: Poll results from 4 users - glad to hear it's working well for you!

Sunday, January 9, 2022

Console.log CSS Hacks

Short technical post here. If you're a developer, you might be wondering, "Isn't it a bit complicated to see what's going on when you try to debug Wingman?"

Yes! Some of it definitely is, especially trying to keep track of multiple request threads or scanning video frames. But one feature that has made life significantly easier is the ability to place CSS in console.log. I use this to log out debug images. For example, right now I'm trying out a feature to tile images with huge aspect ratios, and this makes it significantly easier - I can base64 encode a thumbnail and log it out like this:

 

 Give it a whirl the next time you need logs with a bit more than ASCII art!