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

167
Views
Prevent internal location changes of iframe from affecting browser history

Note: There are many questions asked where the poster is writing a new location into the iframe from the outside, and is told to use location.replace. This is not what is going on in my case.

Edit: I left my initial description in below, but I decided to describe the issue again in simpler terms. If I do not have any control over the location change of an iframe, so I cannot use location.replace, how to I stop the iframe from touching the history of the browser?

Original description: My web application is running an angular app in an iframe. User behavior in this angular app often causes new locations to be written to the iframe, which apparently cascades up and adds new items to the browser history. Is there a way to block the iframe from affecting the outer browser in this way, so the history is not touched at all by the inner angular application?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The sandbox attribute of the iframe may solve this problem. Using the sample program of Angular router for testing. As long as the sandbox only sets allow-scripts, the iframe will not affect the navigation of the browser.

<iframe src="your url" sandbox="allow-scripts"></iframe>
about 4 years ago · Juan Pablo Isaza Report
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!