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

160
Views
Feature policies dropped when React app is loaded in iframe

I'm adding a feature to a react app (app A) which loads microservices in different tabs. This is a legacy system and achieves this by using <iframe src="..."> returned as a component and consumed with <Route>.

Now the source in question loaded in the iframe also happens to be a react app (app B). When I run App B standalone and log document.featurePolicy.allowedFeatures() I see 46 items, 'microphone' included. The result of the same log after being loaded in App A's iframe is 6 items: ['picture-in-picture', 'document-domain', 'sync-xhr', 'ch-ua-platform', 'ch-ua-mobile', 'ch-ua']. I have tried logging the allowed features in App A (before it loads the iframe) and it results in 46 items. So somewhere between App A calling the iframe and App B loading itself, we are losing features.

I have searched for solutions for a while now, I have tried this on chrome and firefox and I have tried using allow='microphone' in the iframe with * and the src url but no luck. For context, here is a highlighted screenshot of the properties structure of the iframe: resulting iframe prop structure

Any ideas what might be dropping the policies or how I might be able to enforce them in App B, seeing as I can't seem to apply them via App A's iframe.

Update: I have tried explicitly adding Feature-Policy and Permissions-Policy response headers to App A (tried multiple sources for validation) but I still get the same result of them being dropped in transit to App B

Update: I have also tried other iframe properties (allowFullscreen, tabIndex, etc) and can confirm they work, but anything under allow seems to leave an empty string in the rendered properties and pushes it into reactInternalInstance.currentElement.props as shown in the screenshot. When I use allowFullscreen this also adds 1 extra item to the allowedFeatures() array in App B so that means the iframe's feature policies can be modified from App A.

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

0

So apparently React (or my version) doesn't know about or process some attributes in iframe, allow being one of them. However, I managed to resolve it by passing the iframe element into dangerouslySetInnerHTML attribute of the parent .

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!