Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

275
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!