Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

256
Views
External JS mutates browser history in Vue application

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.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!