Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance - Intersection Observer? #2935

Open
saxamaphone69 opened this issue Feb 9, 2021 · 5 comments
Open

Performance - Intersection Observer? #2935

saxamaphone69 opened this issue Feb 9, 2021 · 5 comments

Comments

@saxamaphone69
Copy link
Collaborator

saxamaphone69 commented Feb 9, 2021

In the event that the minimum version of Firefox/Chrome get bumped up, I would assume that 4chan X could use IntersectionObservers to detect elements within the viewport or otherwise.

The relatively recent blog post on the performance of the new GitHub home page reminded me of that time I was trying to determine the negative reflow/render effects on elements when applying my userstyle.

I've also noticed that default 4chan has added the lazyload attribute to thumbnails. Not sure if the benefits would still work on elements rendered by 4chan X in a userscript manager. This got done, nevermind.

@paradox460
Copy link
Collaborator

This would help with what >>91904180 is requesting:

Can you add a setting for Linkify so that it only changes links when it's in view instead of trying to change them all when you load a thread?

@ccd0
Copy link
Owner

ccd0 commented Mar 6, 2023

Looks very helpful. For older browsers, we could write a polyfill. It wouldn't necessarily have to be a complete polyfill that does everything IntersectionObserver does, just the stuff we are using in the script. It might take the form of one or more utility functions that use IntersectionObserver if it's available, and do it the old way otherwise.

@ccd0
Copy link
Owner

ccd0 commented Mar 6, 2023

Although since Firefox v55 is already pretty old, it might just be easier to drop support for versions older that it. We should check whether it made it into the various Firefox forks people use.

@saxamaphone69
Copy link
Collaborator Author

Both WaterFox and PaleMoon added support in 2019 by the looks of it FWIW. Not sure which other "major" Firefox forks are out there that are worth worrying about.

You know me and how I feel about bumping the minimum browser version (all for it).

@ccd0
Copy link
Owner

ccd0 commented Mar 6, 2023

If that's the case, it should be safe to bump the minimum version as soon as someone writes the code for this, although if it happens before the Javascript rewrite is finished we may want to delay the release to combine it with that. If we get any complaints then we can look into polyfills.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants