Home

facebook/react

Status:Indexed
Analyzed 3d ago240K+ starsJavaScript

The library for web and native user interfaces.

Back to Pull Requests
#35208Open
Moderate Review

[DevTools] Enable minimal support in pages with `sandbox` Content-Security-Policy

by mochiya98Nov 25, 2025
View on GitHub

Summary

This pull request enhances React DevTools to work in pages with strict Content Security Policies (CSP) by adding a fallback mechanism. Instead of exclusively relying on `chrome.devtools.inspectedWindow.eval()`, it now attempts to execute code via a content script when `eval` is blocked. This makes many DevTools features functional again in sandboxed environments, though some console API functionalities will remain unavailable.

Changes

+390 additions-54 deletions

Impact Areas

Developer ToolsContent Security Policy (CSP) HandlingBrowser Extension Functionality