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

Observer unable to listen on body.replaceWith() #22

Closed
iniznet opened this issue Sep 27, 2022 · 1 comment
Closed

Observer unable to listen on body.replaceWith() #22

iniznet opened this issue Sep 27, 2022 · 1 comment

Comments

@iniznet
Copy link
Contributor

iniznet commented Sep 27, 2022

I'm using flamethrower as a client-side router that uses .replaceWith() to update the whole document.body and the observer unable to catch it.

After further investigation, the .replaceWith() seems to create a new body instance resulting in the observer missing its targets to monitor, there's no log coming out after the body is replaced.

For now, I temporarily fix it by changing the observer target into documentElement and condition to watch the title & body changes when the entry target is head or HTML, then body children.

@Accudio
Copy link
Owner

Accudio commented Sep 27, 2022

Fixed in v0.4.1! Thanks!

@Accudio Accudio closed this as completed Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants