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

95
Vistas
Identify the sender-iframe from message when sandboxed

Fictional situation for simplification:

  • I have a grandparent page containing one parent iframe displaying the "parent page".
  • This "parent page" contains two children iframes childA and childB.
  • All the iframes are sandbox="allow-scripts" for security reasons.

parent sends and receive messages from/to grandparent, childA and childB.

When parent receives a message, I need to be able to identify the sender, but I can't find the right approach, as the origin of the event is null:

function onReceive(message) {
    // origin is null when the message comes from a sandboxed frame.
    console.log(message.origin);
}

Do you know a clean way to know who does the message come from?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

OK, it was simpler than I expected. I actually can compare the message.source property with the contentWindow of the child iframes, or window.parent for the grand parent.

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