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

205
Views
Removing a Content Security Policy in React is still active?

I have a React Router app, and I need to have a content security policy just for one of the routes. So, for that route I have this inside a component:

  useEffect(() => {
    const csp = document.createElement('meta');
    csp.httpEquiv = "Content-Security-Policy";
    csp.content = "default-src 'none'; style-src embed.typeform.com; script-src 'self' embed.typeform.com; frame-src form.typeform.com";
    document.head.append(csp);
    return () => {
      document.head.removeChild(csp);
    }
  }, []);

My problem is that even though the code works, and the meta element is added and deleted as intended, Chrome doesn't remove the policy internally and it is always present once I have attached it once. So i get a lot of default-src 'none' errors on the other routes.

Any idea what is wrong?

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