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

264
Vistas
How to safely load a Component using Eval inside?

I know the title might make you confuse.

I have a ParentComponent called ChildComponent.
ChildComponent using eval to do some stuff. And the worst thing is, the eval's value can pass by users.
Maybe users will input some bad thing for the whole application, so I'm trying to prevent it.

The first solution that comes to my head is loading ChildComponent into an iframe (like a code-sandbox), so it can protect my Application (anything eval just affect the iframe).
But it has some problems: styles couldn't load correctly.
I asked about that problem but got no answer How to load completely an Angular component into an iframe?

I'm stuck, any idea for my problem is really appreciate

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

0

First, an iframe doesn't prevent anything.

You can just call window.parent to get a reference to the parent window.

Second, this looks like an XY problem : do not ask for help on what YOU think is the best solution, but rather explain the goal you are trying to achieve.

Finally, know that eval will NEVER be safe, so you should use it at your own risk.

But then again, JS as a whole is not safe, you can just open the dev tools and hack into any website.

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