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

170
Vistas
Send messages between apps within same browser window

I have two separate web apps, an angular parent app and a react child app. The parent app is loading the child app in an iframe. I am trying to have these apps talk to each other using window.postMessage() but either the message isn't being properly sent or it isn't being received.

Here is exactly what I've tried.

Parent App:

window.postMessage(message, "*")

Child App:

window.addEventListener("message", (event) => {
     console.log(event)
}

The only thing I have to go off of is when I console log the window on the parent, I see:

postMessage: f postMessage: ()
   length: 1
   name: "postMessage"
   arguments: [Exception: TypeError: 'caller', 'callee', and 'arguments' properties may not 
               be accessed on strict mode functions or the arguments objects for calls to       
               them at Function.s (<anonymous>:1:83)]
   caller: [Exception: TypeError: 'caller', 'callee', and 'arguments' properties may not 
               be accessed on strict mode functions or the arguments objects for calls to       
               them at Function.s (<anonymous>:1:83)]
about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The parent must dispatch the message from the window of the target (child process, iframe in your case) not from the window object of the parent:

const child = document.querySelector('iframe').contentWindow;
child.postMessage(message, "*")

about 4 years ago · Santiago Trujillo 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