Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

168
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda