Hacker News new | ask | show | jobs
Show HN: Firefox Addon to Filter NSFW Content (addons.mozilla.org)
62 points by _zephyr 1313 days ago
10 comments

Does it have an option to filter both ways? Do not show NSFW vs. show only NSFW? The latter would probably be use a lot more.
Doubt it, there is no pressing need to exclude non-nsfw but parental control and porn addiction help have significant demand as well as people who fear getting accidentally in trouble at work.
Dollars to donuts, I bet porn has a lot more demand than porn addiction help.
To be a bit more explicit than badrabbit about why the symmetry isn't there:

The problem a filter like this is meant to solve is: You go on the web reading random stuff, and occasionally you run into something pornographic when that isn't what you're after, and it's unwanted (because you're at work, because you find pornography disturbing, or whatever).

So the problem its inverse would solve would be: You go on the web reading random stuff, and occasionally you run into something non-pornographic, and that spoils your fun. Or maybe: You go on the web looking for pornography, and occasionally you run into something non-pornographic, and that spoils your fun.

So far as I am aware, those are not problems anyone has.

Variations on the theme: You might be looking for some specific variety of pornography and keep finding pages with different kinds. I don't think this sort of tool would help with that; all it can do is filter out unwanted bits of pages you've already found. Or you might be successfully finding pornography but not want to see any other clutter -- e.g., advertisements on your screen distracting you from it. But I'm pretty sure the only people advertising on pornographic websites are highly NSFW themselves, so I wouldn't expect a reverse-NSFW-filter to help with that either; what you want for that is an ad blocker.

> So far as I am aware, those are not problems anyone has.

Rare moment I can chime in to the opposite, this is an issue and there is an anti-sfw filter built in to some sites.

The use case is for imageboards primarily where trivial arguments spring up easily, the "fap time" sfw filters remove text only posts and posts without nsfw imagery.

For sure but it isn't drowned out by non-porn if you look for it is what I mean.
I can't help but find the whole NSFW filtering thing incredibly funny since I found out there's a "healthy" fetish community working on this problem, with Chrome extensions like "Beta Safety" or "Beta Protection"
That reminds me of repackaging a traditional historical male dominated marriage, including occasional corporal punishment, as a BDSM kink to make it normal again. You think you’re seeing a woman in a dress, but actually it’s fetish gear showing her submission.
What are you talking about? There are plenty of male subs looking to be dominated by women. And either way, it's generally understood to be primarily a sexual kink only consented to by both parties. If it's not consensual, then it's not BDSM, it's abuse. BDSM is also wildly different from marriage of any kind - you might be thinking of 24/7 power exchange?
It’s entirely possible to view a traditional patriarchal marriage as a fully consented to 24/7 power exchange with domestic service and impregnation kinks to round it out. That’s not abuse, it’s just a kind of scene you may not personally be into.
I don’t know if comment you are responding to was edited after response, but you may want to reread it:

> That reminds me of repackaging a traditional historical male dominated marriage, including occasional corporal punishment, as a BDSM kink to make it normal again. You think you’re seeing a woman in a dress, but actually it’s fetish gear showing her submission.

That’s clearly a joke about normalizing historically traditional roles between men and women, with the man being dominant and woman being submissive. Says nothing about there being men wanting (or not wanting) to submit.

I don't see how it's a joke. It's clearly criticism and making an unjustifiable judgment. BDSM has no preference about which gender is submitting or which is dominant.
> It's clearly criticism [...]

I'm having trouble seeing where you see criticism in that post. Could you help me understand?

> BDSM has no preference about which gender is submitting or which is dominant.

Where does OP suggest otherwise?

> I don't see how it's a joke.

I'll expound below, but in short: I see the original comment as being a joke at heterosexual men's expense, in particular those who wish to dominate their wives.

For posterity, here's the whole quote:

> That reminds me of repackaging a traditional historical male dominated marriage, including occasional corporal punishment, as a BDSM kink to make it normal again. You think you’re seeing a woman in a dress, but actually it’s fetish gear showing her submission.

And this is how I understand it:

> [...] traditional historical male dominated marriage, including occasional corporal punishment

So what we're talking about here is marriage, and one premise is that, historically speaking, men are in a dominant role. I don't read this suggesting any judgement (good or bad), only that it has, historically, been the case.

Also, corporal punishment was not uncommon (and, sadly, domestic violence is still a serious issue). If if we find (as we will in the proceeding text) a suggestion that corporal punishment, or some facsimile thereof, should be preserved, we have two interpretations that we can proceed with: 1) the poster is a flagrant asshat and is being serious, or 2) comedic irony is about to be employed. To each their own choice, but I'm going with option 2, as I suspect most people would have enough sense to keep assholery to themselves: Occam's Razor suggests the second option.

Zooming out a bit:

> That reminds me of repackaging [...] marriage, [...] as a BDSM kink to make it normal again.

The use of repackaging here means, roughly, "same essence internally, different outward appearance". So we're talking about "repackaging" traditional marriage -- that is, preserving the "traditional" role of men dominating their partner, but under new pretenses.

> [...] as a BDSM kink to make it normal again.

I see that this could be taken as a slight. If we're making it "normal again", that implies its not normal now, which could be taken as a negative judgement toward BDSM. While I can anticipate this interpretation, I think its a stretch, and an uncharitable interpretation.

Regrettably, just about all kinks (and often, sadly, sex itself) is considered taboo. That's the reality of our modern (and historical) views on sex. So a proposal, whether in seriousness or in jest, to make BDSM "normal again" doesn't imply any positive nor negative sentiment towards BDSM.

> You think you’re seeing a woman in a dress, but actually it’s fetish gear showing her submission.

This is the "repackaging" referred to earlier, and the punchline of the joke. The butt of the joke is heterosexual men who would like to dominate their wives.

In the interest of diversity, I suppose OP could have picked any other pair of genders -- for instance, they could have spoken of a woman dominating her husband or wife in the same manner... but the joke wasn't about BDSM in the first place, the joke was about a subset of heterosexual married men, and their penchant for being dicks to their spouses. It's not like there aren't any abusive women, but rather that it would make for a bizarre joke if structured that way: men are usually the aggressors. Humor is essentially the combination of a banal setup with an absurd, unexpected conclusion.

Anyway, that's how I read the original comment, and, aside from the interpretations I rejected as unlikely, I can't think of any other way to read it. If I'm missing something, or you have a different perspective, I would legitimately be interested in hearing it. Thanks in advance!

General reminder: BDSM does not imply "man dom, woman sub". In fact it doesn't even imply how many people are involved and what their genders are.

Edit: Why am I being downvoted for pointing out something objectively true?

Why are you asking _why am I getting downvoted _ ?

https://news.ycombinator.com/newsguidelines.html

Because I was at -1 after just 10 minutes and no one was engaging in discussion about why what I said would not be correct?

And, please, let's not pretend to be socially inept machines - everyone here chooses to ignore a guideline or two when it's convenient - at least I was looking for actual feedback, as I was sincerely puzzled by the situation.

This is hacker news
Looks like a great tool for recovering addicts everywhere. I hope to see more innovation in this space, particularly on mobile.
What kind of innovation would you hope for on mobile? In theory this can work for Firefox for Android but ... the experience isn't very smooth yet.
Something that could read the screen at any point in time, across apps and flag/filter NSFW images, all running with a local model and no outgoing internet connections would be pretty neat.
Unfortunately my experiences with mobile app stores put that likely in the "not possible at all" category rather than the "tricky" category like it might be for desktops.
Maybe I am being stupid, but I cannot see anywhere where you describe what you consider to be "NSFW"
Looking at the code, it looks like they're using TensorFlow to rate images, videos etc. [0], specifically the SQRX family of models [1].

[0]: https://github.com/wingman-jr-addon/wingman_jr/blob/79a1a882...

[1]: https://github.com/wingman-jr-addon/model/blob/master/sqrxr_...

The description itself is NSFW so it got deleted the second they wrote it since they were running the addon at the time. Just goes to show how effective it is /s
The "About this extension" section has in the top paragraph:

  It targets pornography, borderline sexualized content, as well as other graphic images that are not safe for work (NSFW) or may be inappropriate for children.
And then more details as the other commenter pointed out: https://github.com/wingman-jr-addon/model#dataset

Your response is interesting because it tells me you maybe expected it to be in a different spot - was there a specific spot you were looking at? Might help me improve the descriptions.

Ok, then what I mean is "what do you consider to be pornographic"?

In some countries it's not NSFW to see a naked breast, I am going to assume this software does not take that into account.

Am I right?

A bigger point one could make is that this is projecting your cultural norms onto the internet as the "default".

It's a cool idea, though.

I don’t know why but this immediately make me think of the “cloud to butt” addon.
I'm guessing this will never run on Chrome, especially after manifest v3?
Your guess is correct.

By killing the filtering possibility, Chrome made itself a weaker browser from the NSFW-prevention standpoint as well.

While this addon can never run on Chrome, you may find this other project to be of interest: https://github.com/nsfw-filter/nsfw-filter I've talked with the developers there from time to time.
When I was a kid, I remember enjoying figuring out how to bypass our internet filters at school by using the trick where you can convert an IP address into a number. I had never been too keen on filters but after that incident it planted a seed of an idea: could there be a better way? Perhaps make the process more intelligent? Watching the incredible advancement of image recognition over the last decade, it seemed that maybe someone could build something better for the browser - something that actually scanned the content directly rather than relying on lists. When Firefox 57 came out several years ago, it added the webRequest.StreamFilter API and as soon as I saw that I knew that I wanted to take a crack at creating a content-based filter of my own with a focus on NSFW pictures. That API is critical because it allows for truly blocking at the stream level, rather than relying on web page fixups - which also means no Chrome. I soon found Tensorflow.js which made things much easier. By late 2018, I had a first cut and I released it on the Mozilla Addons site as Wingman Jr.

It's been quite a journey since then! I developed the bulk of the code but have had a bit of community help as well. There is now a small but steady user base, and I've learned so much.

* NSFW content detection is a hard task - I believe much harder than just general image recognition, and whereas many think of of image recognition as "solved", I would argue that NSFW content detection is far from it.

* Having your own dedicated toolset to assist in creating and managing the dataset is invaluable. I was surprised to see that as a single individual it was quite feasible to create a fully-curated dataset in the hundreds of thousands.

* Servers are more different than laptops/desktops than one might think. I had a good time setting up an old Supermicro with K80's on a budget.

* For this problem at least, even several hundred thousand images was still not enough to see an advantage on training from scratch vs. tuning a pre-trained model.

* Fun ways to slice up GIFs at a "transport" layer to allow for good-enough filtering on frames.

* Character encoding detection is a hard problem, and the existing filtering API's don't do a good job of helping the developer down the right path.

So with development being relatively stable for quite some time, why share now? Well, I've kept the addon fairly "primordial" in the sense that I haven't tried to cater too heavily to narrowed use cases yet. Three general use cases seem to be represented based on user feedback - there are others but so far this is what is being said:

* Adults casually enabling it for daily browsing. Think things like browsing stock photo sites, Google Images, etc.

* Adults struggling with pornography and looking for tools to help.

* Adults looking for an extra safety net when their kids browse the web.

I'm contemplating adding more specific feature sets in one or more of these areas, but thought that it might be a good time to put it out there and get some perspectives. The tech is far from perfect, but it seems that it is good enough that it is helpful for some users.

It's also my hope that there's potentially some things to share here that the HN crew might find of interest. (Although I can assure the UX is not currently one of them!)

* The addon itself (https://addons.mozilla.org/en-US/firefox/addon/wingman-jr-fi... and https://github.com/wingman-jr-addon/wingman_jr) - maybe it's not your thing, but if you're like me, there's a good chance somebody in your family might find it useful

* The model (https://github.com/wingman-jr-addon/model) - I've tried to make a competitive model for its size, such that enterprising individuals can try this as an alternative to paying for API calls. It does not use NSFW.js as a base. Both .h5 and TF.js models are provided. Maybe it'll be good enough for your use case?

* Real world examples of the webRequest.StreamFilter API. In particular, the bit about character encoding is probably worth a short read if you're thinking of using this API yourself. See https://github.com/wingman-jr-addon/wingman_jr/blob/79a1a882...

* Examples of image-based logging for Firefox.

* Some fun GIF parsing stuff!

Thanks!

How big is the model? I see the extension itself is 15MB, but does it download the model later?
That's with the model actually! It's copied into here: https://github.com/wingman-jr-addon/wingman_jr/tree/master/s... The model is 13.7MB currently.
I'd love an extension like this to remove useless news from my favorite newspapers. Anything related to murders would be a great start.

I want to read the news, but lately there has been so many news along the lines of "X person was murdered in a city far away" that it's becoming unusable.

i tested this on reddit r/celebs and got nice results. nice as in, sure, photos were marked and it did a good job....

is this selfhosted as in no external connections?

Correct, operations are all done fully local to the browser. If you opt in to the Cloudflare DNS option, it'll check using the hostname only.
ok. that is super cool. thank you for making this nice piece of tech. hopefully it can be integrated into more stuff
I don't get why these filters are needed. I was relatively early to the internet compared to most people (I'm 33 but I grew up on the internet since around the age of 7) yet I grew up perfectly fine without needing to be blocked from adult content. A kid seeing a sex scene in something they stumble upon is not going to scar them for life... Additionally I was never forced to use a piece of school equipment that had filtering. The most I experienced filtering was when I, on the rare case, happened to use the computers at the library instead of the ones at home and laughed at/was annoyed by the silly filtering.

Much worse than adult content is addictive content that forms obsessive behaviors (things like Tiktok or more lightly social media in general).

The other thing to be wary about is when it's possible for a child to give their private information away to someone in a way that can harm themselves. i.e. make sure cameras are non-functional on any child's device. That wasn't an issue when I was a kid but is very much a danger today.

It's called consent. For a minor, their parent or guardian must consent to show them adult or other traumatizing content. Despite your personal experience, parents and guardians ultimately have the right,authority and responsibility to do their best to ensure the well being of a minor under their care which could mean no porn or even no meat in their diet. You don't have to agree.

> Much worse than adult content is addictive content that forms obsessive behaviors...

There is literally nothing more addicting than porn. Not only that but the long term social and behavioral issues that result from porm addiction are far more harmful than for example cocaine or lsd (which isn't addictive).

But let's say porn is not harmful or addictive, showing porn to people against their consent is a form of sexual abuse much like exposing yourself in public is (despite nudity laws). It boils down to the fact that biologically speaking naked people arouse a sexual reaction and sexual interactions of any kind must be between consenting parties. Period.

This isn't about policing morality but consent and it is a shame that it is neccesary to begin with.

> There is literally nothing more addicting than porn.

Citation?

> biologically speaking naked people arouse a sexual reaction

Have you never been to a nudist beach?

-------

> not [...] morality but consent

"morality" is not distinct from consent: it's more that your/my/our position on sexual morality is grounded in individual consent. "morality" as a word is not shorthand for (Western) Christian or Victorian traditional attitudes and prejudices.

people really loose sight of “normal habits” when talking about sex. there’s this intense religious shame, so the folks with the most fucked up libidos assume everyone must be like them. i see posts like this as a confession, much less an anecdote
Religion has nothing to do with it, you are changing the subject and attacking me personally by claiming I am confessing to shame or something (like I give a shit):

Try sticking to facts. Naked people arouse sexual desires in others, yes, myself included and most people from any country and religion (or no religion). If you contest this near universally accepted fact the the burden of proof is on you.

I mean give me a break, even if this was a super religious person keeping themselves or child away from sexual content who are you to tell them they have no right and they must see your dick or vagina whether they like it or not.

Laws are literally getting passed against sending dick pics, how do you feel about that? Is that women who feel shame that support it? Of course not!

nudity has nothing to do with sex as you’ve said elsewhere, it’s all about consent. i don’t sexualize strangers, because i don’t have their consent. when i walk around my home nude, i’m doing it because i’m comfortable being nude. it’s a preference for me, but people like who who can’t see nudity without complaining about “sexuality and sexualization of all nude bodies” bore the shit out of me. convince me your stance is different in anyway from demanding a burqa? the logic feels the same to me, cover up because i can’t control my own body, and it’s not my fault!

grow up and stop thinking about fucking everything you see naked, it’s odd

as someone who used to have exactly this sort of internalized shame, i think you've hit the nail on the head 100%.

let's look at the statement: "biologically speaking, naked bodies arouse a sexual reaction".

i'm wary of this way of thinking. here's one possible consequence: "anyone who chooses to be naked around me is trying to interact in a sexual way"

when boiled down, the same root of thought leads to dark conclusions, like

- "she was asking for it because she wore revealing clothing"

- "i was sexually aroused and therefore couldn't control myself"

No no no! You and the parent comment are ansolutley twisting what I am saying and turning it into a personal attack.

I can't believe this, are you saying naked people don't sexually please other people? That's basically all I said.

Internal shame my ass. How about I use the samw logic and claim you have an internal perversion and desire to abuse others against their will, would that be fair? It works by your messed up logic but I know it is an unfair thing to say so I would never say that.

Facts are facts, let's stick to those. Maybe there are a small minority that feel no sexual desire when they see a naked adult person but since majority are not wired that way (even if they were a minority actually) you have to ask permission first. That's it, ask permission.

And people like you love to blame your upbringing or religion so you can make it about that. Stick to facts. You can pick a random atheist from scandanavia, a chinese buddhist, a muslim from pakistan and an african with a local religion (men that is) and show them a naked porn star and most if not all will be sexually aroused. This is hormones.

"showing porn to people against their consent is a form of sexual abuse" is more descriptive then your quotes I believe, at least this kind of precautions adds an alarm/notification options between kids in social media and twisted adults
As far as biological reactions go, in certain countries lots of people visit public saunas naked and find nothing sexual about it. People’s perceptions of nudity vary by culture.
The keyword there is visit, it is consensual. People kiss on the lips without making it sexual as well but you still need consent right? If all parties consent I have no problem with it. Why do people have a need to expose others to their nudity or to sexual content against the consent of other people? Even nude beaches have a sign so that non-consenting parties can stay out. That's my standard for public nudity, it should not be allowed everywhere just in areas line parks and beaches with clear signs for others so long as there are similar public places where people who don't consent can go to.
do you see the difference between "user stumbles across sexual content" (the previous conversation topic) and "showing porn to people against their consent"?
How do you mean? Presuming a person give consent by default and making it public and accesible without warning and explicit consent is the same as ... well not asking consent . Same logic as nude texting and flashing.
You give consent to be served search results that match best fit with some content filtering based on best intentions.

Implied is an understanding that despite best intentions of the search provider, stuff may slip through.

This is vastly different than being flashed.

My comment was more general than search results. All the major search engines as you said make best effort to exclude nsfw content by default and I have no problem against that.
> or even no meat in their diet. You don't have to agree.

Somewhat irrelevant, but: do parents actually have a right to enforce a no-meat diet on their kids?

I understand (say) having a "no meat in the house" rule, telling your kids not to buy meat products with your money, and/or only cooking vegetarian food.

But requiring your kid to adopt a vegetarian diet at all times--even when they're away from home--seems excessive.

Maybe it's OK at age 5, but once the kid is old enough to understand the distinction it should be entirely their choice.

You may disagree with it but so long as the kids get all the same nutrients from other food sources and they don't go hungry it is the parent's discretion what the child eats. Otherwise it would be the government or society that raises the kids not the parents or guardians which are the people who have the most affection and desire to see the best outcome for that specific child. If a parent or guardian is acting in malice or willful ignorance of facts that will result in harming a child, I have no problem with the government stepping in and figuring out who else would be best suited to care for the child.
I'm not saying, of course, that such a parent should have their kids taken away by the government.

But I do think that a good parent would grant their kids a certain level of privacy and autonomy, depending on the child's age and the risks involved.

In this case, the risks of a kid eating meat are fairly low; one kid's chicken tenders aren't going to build a factory farm, and they can always change back to a vegetarian diet later.

(Of course, some vegetarians will have stomach issues if they suddenly start eating meat. The kid should know about that risk, but the reactions in question are usually very mild.)

Oh, yeah, I don't agree with that, no problem with moderate meat consumption. I mentioned it in my first comment as an extreme example of what parents can do at their discretion.
Yes - they can, though by the time they become teenagers, what is a parent going to do if they disobey and eat meat?

Funny story though - we have a family relative with younger children who was raising them strictly vegetarian. No meat (the mother insisted), though the dad quietly admitted he eats meat on occasion much to her chagrin. On a family vacation the children were left at the house for dinner, and another relative began preparing a chicken dinner.

The conversation between that relative and the children went something like this:

"Dinner's ready! Come get the chicken!"

"This doesn't have meat in it, right?"

"What? Well, it's chicken!"

"Right, but does that have meat in it?"

"Well... No... Certainly not. This is bona-fide, 100% pure, Grade A Chicken. Now eat!"

> It's called consent.

You don't appear to understand what that word means. This has nothing to do with consent.

> For a minor, their parent or guardian must consent to show them adult or other traumatizing content.

Pray tell how adult content is "traumatizing"? Before the internet kids used to pull porn magazines out of the trash or sneak down late at night to watch their parent's adult channel subscriptions. Finding it on the internet is the modern era's version of that. Probably in a few more decades we'll have a new version of it again.

> Despite your personal experience, parents and guardians ultimately have the right,authority and responsibility to do their best to ensure the well being of a minor under their care which could mean no porn or even no meat in their diet. You don't have to agree.

I fully achnkowledge that parents have the _right_ to control content if they so wish, however my argument is that they are absurd for doing so. It's not a matter of the child, it's a matter of the personal morals of the parents.

> But let's say porn is not harmful or addictive, showing porn to people against their consent

No one's talking about showing children porn against their consent.

> This isn't about policing morality but consent and it is a shame that it is neccesary to begin with.

That is absolutely what this is about.

> This isn't about policing morality but consent and it is a shame that it is neccesary to begin with. >> That is absolutely what this is about

No, that's the strawman you want it to be about. Neither I nor no one else talked about preventing any willing person from interacting with sexual content.

That's the entire point of internet filters. To prevent people from accidentally or intentionally seeing it.
“I don’t need it so no one needs it” is the summary of your post. Not a very constructive statement, and you’re not asking a question either, because if you actually wanted to know you would’ve looked it up, or if you’re so in tune with the needs of others, you’d already know. So what sort of conversation are you aiming to have?
I'm saying all children don't need it. Unless you can come up with a specific reason that would make it so one would.
Then don’t get the addon? You’re not really saying anything interesting or constructive. I’m not sure why people wanting something you don’t would throw your world into a state of chaos.
I…I…I…

Shame on people who would even fathom forbidding access to certain content on the devices that they likely pay for, internet that they pay for, homes that they pay for, and to children who they raise. Shame.

The gall people have to make their own choices… and they won’t even affect me? Appalling.
Exactly. Child abuse is never okay, especially if the perpetrators think they have a legitimate rationalization for it.
Porn addicts might need filters like these.