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!

Monday, January 3, 2022

Mattermost Breaks?

 Hello! I got a report from a helpful user "pakxo" about the web app Mattermost (redacted a bit):

I have an issue while using Mattermost. The extension becomes so so slow and sometimes break, often times break on Mattermost. ... I don't think it's a performance issue. It's more like a bug or something.

Pakxo also indicated that it breaks more on his PC, which has a decent graphics card.

I don't regularly use Mattermost, but I did try out the community site here: https://community.mattermost.com

Unfortunately, I wasn't able to reproduce any specific issues like pakxo had listed. If anyone else has problems with the web app - please let me know! I'm tracking the issue on GitHub here.

Sunday, January 2, 2022

On/Off Switch

 Just got some great feedback from "someuser":

Loving the extension so far, but I'd like to ask if it's possible to add a toggle to quickly enable and disable the extension, either on a per-page basis or globally. While the "trusted" toggle seems to work fine, sometimes I'd prefer to temporarily disable the extension without going through firefox's menu. Thanks.


Well, "someuser" - you're not the only one who's wanted to do this, and it's actually already a feature!

If you go into options, you'll see this:

 

Then when you go to the main button's dropdown, you get a new "On?" checkbox at the top:

 

It works globally, not per-page like say, uBlock Origin does. As a bonus, turning the addon on and off this way is much faster than disabling and re-enabling it not only because of the extra clicks, but because it also keeps the AI model loaded so it doesn't have to do the long several-second startup.

As a note, the reason this is not on by default is that some folks use this for their kids so I don't want it be shown by default. But for those that do want to use this feature, they tend to want to use it all the time, so making it an option seemed like the best balance.

Thanks for the feedback "someuser"! As a quick note: I always appreciate feedback as it helps me know how people are using the addon. There's a quick feedback form in the menu there, but any time there's an upgrade, I've got a short little survey. Please, if you would, consider filling it out sometime! One big thing it helps me understand is how folks are using the plugin so I can better understand where to focus my efforts.

Thursday, December 30, 2021

Thumbnail Scanning Size

 Let's talk about thumbnails here for a bit.

Usually when you're dealing with an image classification problem, if you can figure out what the thing is, then you can classify it, which is easy. But for NSFW content, this turns into a bit more of a grey area. Sure, there are some things that - no matter how small - are clearly NSFW. But for others, as an image either scales down in size or becomes more abstract, it starts to cross a line where it goes from R to PG or even G. Where exactly one should draw this line is quite subjective.

I just received a feature request from a helpful user, Sneed:

A setting to optionally block small thumbnails or set an arbitrary minimum/maximum would be nice. The thumbnail for the image on this webpage does not get blocked, when you click it to expand, it IS blocked.

I've definitely run into this too. The current logic is around this area of the code and basically has two conditions to skip blocking: if an image is less than 36x36 pixels or the total image size is less than 1024 bytes.  The size in bytes is perhaps less obvious, but the idea is that an offensive image generally needs a certain amount of complexity, so if I can indicate that the image is too small by just the number of bytes, I can skip even decoding the image to find the true dimensions which helps with performance.

This is an area I haven't turned my attention to in quite a while, so I'm going to give it some thought. I'm tracking it over at this issue on Github, so feel free to join the conversation there.