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

140
Visualizações
Cross-origin issue when updating the iframe's height. Content loads correctly

I have the following iframe:

<iframe style="width:100%;border:none;margin:100px 0px;" scrolling="no" src="https://seifti.io/document/policy/priva?l=es&c=f8ba59746ab55688799b9b16ebac73d749952ebcc5ae4d9d91d939d5c48f3baf" onload="this.style.height=this.contentWindow.document.documentElement.scrollHeight+'px'"></iframe>

The content loads correctly, but the following function that executes onload:

this.style.height=this.contentWindow.document.documentElement.scrollHeight+'px'

which aims to set the appropiate height of the iframe based on its content's length, provokes the following error on the browser:

Uncaught DOMException: Blocked a frame with origin "http://seifti.test" from accessing a cross-origin frame at HTMLIFrameElement.onload http://seifti.test/site/policy/privacy:222:317)

I do understand that the browser would not allow me to manipulate the iframe's content by using Javascript, but in this case I'm just trying to update it's height?

What would be the best workaround?

about 4 years ago · Juan Pablo Isaza
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