Title in browser's tab is 500ms behind the DOM rendering when using navigate/push

For some reason the title in the browser tab is always behind the dom/page rendering like 500 ms or something.

But the same is also a thing is in Next and SvelteKit, not sure about Livewire.

Can it be make to render at the same time as the page?

Sounds like a browser issue. Does this happen in multiple different browsers?

Yeah, it’s happening only in Chrome and Brave for some reason. Safari and Firefox do update the title in tab instantly as it should be.

Even in Brave when I am using no extensions and turn off the brave shield it’s still changed in tab like 300 - 400 ms later unlike in Safari or Firefox where the change is instant.

Looks like LiveView simply sets document.title, but the invocation is wrapped in requestAnimationFrame.

Just a hunch: perhaps the animation frame callback is taking a while for some reason?

Try writing some JS to update document.title with and without a requestAnimationFrame callback and see if you can reproduce that behavior.

Another possibility is that work done by the LiveView JS (diff-related?) takes a long time after the callback is set, thereby delaying it. It would have to be a browser-specific performance issue I suppose. Make sure you test these things without any other tabs running in case that has something to do with it.

Just realized I may have misread this. Are you saying you observe the same delayed behavior in these other frameworks? If so I assume this is just chromium behavior and there’s nothing you can do, right?