dillon1000/react
Commit
Browse files fix[devtools/extension]: added a workaround for proxy content script injection in firefox (#27375)
Changes: 1. [Firefox-only] For some reason, Firefox might try to inject dynamically registered content script in pages like `about:blank`. I couldn't find a way to change this behaviour, `about:` is not a valid scheme, so we can't exclude it and `match_about_blank` flag is not supported in `chrome.scripting.registerContentScripts`. 2. While navigating the history in Firefox, some content scripts might not be re-injected and still be alive. To handle this, we are now patching `window` with `__REACT_DEVTOOLS_PROXY_INJECTED__` flag, to make sure that proxy is injected and only once. This flag is cleared on `pagehide` event.
Changed paths2 files
First-parent comparisonpackages/react-devtools-extensions/src/background/index.js ModifiedM packages/react-devtools-extensions/src/contentScripts/proxy.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…