Comments (30)
we didn't , I just put everything in a single loop, its lazy loading behaviour, if you just mark as checked
not loading content, user can see nsfw images in next scrolls
will check in 12hr
from nsfw-filter.
Yeah. I'll fix it today
sure
accepted
from nsfw-filter.
Difficult bug, lets fix it in the next releases, removed from v1.0.0
from nsfw-filter.
We are getting some coverage on social media. And this lag could be a turn off for some of the users. Although it may work on things like social media sites where NSFW images may occur not that frequently. But the users test them on Google Images and sites like that and although the extension works, the initial lag may be an issue. It could defy the purpose of the extension.
Link: https://www.appinn.com/nsfw-filter/
PS: This article was translated from Chinese?
from nsfw-filter.
Related solution:
Moved to v1.1.0 project
ps. chinese article? dude your marketing skill is awesome 👍
from nsfw-filter.
What will we change, document.readyState? before the EventListner?
Dunno yet, just possible solution
from nsfw-filter.
@YegorZaremba There seems to be a small lag from when the pages are loaded and the images are hidden. Can we fix this?
@yxlin118 is currently looking for a solution to this.
@YegorZaremba Please check in on this.
from nsfw-filter.
Hi, thanks for contributing, so yeah its issue that I tried to solve, thought that document.addEventListener("DOMContentLoaded", func);
will fix it, cause we used(and still use) window load event
, but same behaviour. Please share If you find sth related to solution. I hope I will fix it in next release
from nsfw-filter.
@YegorZaremba Hi Yegor thanks for following up! What do you mean by document.addEventListener("DOMContentLoaded", func);
will fix it but stil lthe same behavior?
from nsfw-filter.
We subscribe on event to know when page is load, there are to events for our case
DOMContentLoaded
– the browser fully loaded HTML, and the DOM tree is built, but external resources like pictures and stylesheets may be not yet loaded.
load
– not only HTML is loaded, but also all the external resources: images, styles etc.
Not sure, looks like first task is load page, then work with extensions, maybe sth to force task into eventloop is helps, setImmediate
or etc, needs time to figure out
from nsfw-filter.
I see. I can look into that. Do you have any useful documentation that you would recommend me to look into?
from nsfw-filter.
@all-contributors please add @yxlin118 for bug, ideas
from nsfw-filter.
@navendu-pottekkat
I've put up a pull request to add @yxlin118! 🎉
from nsfw-filter.
Not really, im newbie in extensions, I use https://developer.chrome.com/extensions/devguide and https://developer.mozilla.org/en-US/docs/Web/API/Window
from nsfw-filter.
Thanks! I will take a look.
from nsfw-filter.
I think currently what I am experiencing is that a lot of times it will only start the filtering process after I start to scroll. Not sure if that's a problem with other people too.
from nsfw-filter.
Yeah, its a another issue :D In cases of websites where JS dynamically render DOM elements, we just set timeout right now line in code
Probably related solution of it
from nsfw-filter.
And a lot of times when I scroll back up the filtered image would reappear and be filtered again. Probably also has to do elements being rendered dynamically?
from nsfw-filter.
Yeah you talk about lazy loading content and its another issue :D, which I'll fix soon #21
from nsfw-filter.
I think I might have a fix using MutationObserver, and it seems to also fix the issue where scrolling might would make contents visible again. Can I be added to the repo so I can push my branch to set up review and pull request? @navendu-pottekkat
from nsfw-filter.
@yxlin118 Please for this repo and create a pull request. I will review the code and add it
from nsfw-filter.
@navendu-pottekkat I don't have access for this repo for me to push a branch and create pull request
from nsfw-filter.
@yxlin118 You can create a pull request by forking this branch and making changes in your forked version and test it out to make sure everything works. Once you have committed to your forked version, you can create a pull request and we will review it and accept. You don't need access to the repo for making PRs.
Check the docs for more info: https://gist.github.com/Chaser324/ce0505fbed06b947d962
from nsfw-filter.
And a lot of times when I scroll back up the filtered image would reappear and be filtered again. Probably also has to do elements being rendered dynamically?
Earlier we handled this using a separate function which checks for valid images. If the images have already been replaced then sets a dataset in the image as shown in the code below:
function validImage(image) {
/*
Checks if the image is of a certain height and width and check if the image has already been replaced,
preventing infinite loops.
*/
const valid = image.src &&
image.width > 64 && image.height > 64 &&
!image.dataset.isReplaced;
console.log('image %s valid', image.src, valid);
return valid;
}
@YegorZaremba Why did we remove this?
from nsfw-filter.
@YegorZaremba Could you also check the PR?
from nsfw-filter.
@YegorZaremba But then we should not be having this issue right?
Also, I am having some problems with @yxlin118 's PR. I am experiencing some issues and some performance issues. Could you check and confirm?
I have invited you as a collaborator. Please check your mail and confirm,
from nsfw-filter.
@YegorZaremba That is a good idea. We should get more eyes on the project and we will fix the bug
from nsfw-filter.
We need to fix this ASAP.
https://www.reddit.com/r/webdev/comments/i13apj/block_nsfw_content_using_ai_opensource_web/fzuw3et?utm_source=share&utm_medium=web2x
from nsfw-filter.
ps. chinese article? dude your marketing skill is awesome
I really do not know how it got there. Maybe because of Product Hunt and the Javascript community
from nsfw-filter.
Related solution:
- https://stackoverflow.com/a/43245774/10432429
Moved to v1.1.0 projectps. chinese article? dude your marketing skill is awesome
What will we change, document.readyState? before the EventListner?
from nsfw-filter.
Related Issues (20)
- Possibility to turn off the filter for a specific element HOT 5
- Cannot connect to background worker
- Doesn't work in kiwi browser
- Unsplash srolled images become visible after few seconds HOT 3
- node-sass is deprecated
- Grayscale filter effect
- Would love a feature toggle button HOT 1
- Android app that does the same thing HOT 1
- Whitelist sites HOT 2
- [Question] How do I build this for Firefox? HOT 1
- instagram hide option not work HOT 7
- Whitelist certain websites HOT 3
- Whitelist websites and full blocklist websites. HOT 1
- Half nude pictures not detect and filter
- This breaks some hover menus on websites HOT 1
- Hide option fails on Google Images when you makes click on an image that was already hide HOT 1
- Intensify blur effect slider bar
- Add icons to indicate filtered images HOT 2
- It's not fully working HOT 3
- Problems with blocking profile pictures.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nsfw-filter.