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

intensity = "viewport" not working on Ajax Blog #101

Open
giahylxag opened this issue Oct 2, 2021 · 1 comment
Open

intensity = "viewport" not working on Ajax Blog #101

giahylxag opened this issue Oct 2, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@giahylxag
Copy link

I have a blog that load subsequent posts by an Ajax button. I have set intensity = "viewport", but new links are not automatically preloaded after Ajax update the content
Any idea about a quick fix really be appreciated

@dieulot dieulot added the bug Something isn't working label Apr 8, 2023
@dieulot
Copy link
Member

dieulot commented Apr 9, 2023

I’ll need to take a look at MutationObserver’s performance on big pages to get some clarity on how to handle that.

The most obvious way for instant.page to handle that would be to use MutationObserver, but I’m worried about the performance impact of it when observing the whole page.

Another way might be to use the upcoming scrollend event, set to ship in Chromium 114 on May 30th, which would apply after scrolling. This would not work when a web app add links without the user scrolling though.

The safest way would be to fall back to mouse/touch interactions for untracked links.

A developer-unfriendly way would be to provide a method to call on each DOM changes, such as instantpage.reapply().

The bruteforce way would be to call setInterval and check that every link present in the DOM (document.links) is tracked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants