In Vue 3 I have <component> which accepts html code that is response from backend.
In that html, there is third party lib that has some methods that uses history.pushState which mutates how browser's back button is working.
Right now, when that component is initialised it doesn't add anything to browser history. Whenever some data changes and external components needs to recalculate, I see that history length is n + 3. This way, when I click back button nothing happens until it is click n times, as in browser history length. By the way URL doesn't change in any way.
My question is, is there anything that could be done to prevent those unwanted additions to browser history?
Tried to catch when user press back button with popstate event listener, but it doesn't do anything as nothing.