Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

255
Vistas
How to get the iframe element from the rendered content when domains are different?

The following iframe is embedded on https://third-party-site.com:

<iframe src="https://example.com/widget" />

https://example.com/widget is rendering dynamic content and I'd like to set iframe's height according to content's height to avoid having a scrollbar.

How could I get the iframe element from the widget page where the content is rendered?

window.frameElement unfortunately returns null because the domains are different:

If the window isn't embedded into another document, or if the document into which it's embedded has a different origin, the value is null instead.

Trying to access the iframe inside iframe's onload results in:

Uncaught DOMException: Blocked a frame with origin "https://third-party-site.com" from accessing a cross-origin frame.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda