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

148
Views
Set headers on sandbox with srcdoc?

I'm trying to set some CSP policies on my sandboxed iframe with allow scripts. Naturally meta tags wouldn't do the trick if the iframe itself has scripts enabled and can just remove the meta tags right? Is there a way to create the iframe with srcdoc and still set the CSP or do I have to load it from a server?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The csp attribute does apply to srcdoc iframes. Being a local scheme, no response headers are needed. Just writing <iframe csp="defaul-src 'none'" srcdoc="something"> will enforce that CSP on the iframe and I guess do more or less what you would like. This is specified here.

Keep in mind that the csp attribute is currently only implemented in chromium. Also notice that the behaviour for srcdoc was just fixed in M90. Prior to that, I believe chromium was incorrectly discarding the csp attribute for srcdoc iframes.

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!