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.
I'm using flamethrower as a client-side router that uses
.replaceWith()
to update the wholedocument.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.