From 6892a15a7173cb9dfc8dbff43ec5b62be2ff6ae7 Mon Sep 17 00:00:00 2001 From: "hoxyq (Meta Employee)" Date: Fri, 5 May 2023 16:36:15 -0700 Subject: [PATCH] fix[dynamic-scripts-injection]: unregister content scripts before registration (#26765) Summary: ## Summary Fixes #26756. DevTools is failing to inject `__REACT_DEVTOOLS_GLOBAL_HOOK__` hook in incognito mode. This is not happening straight-forward, but if extension is toggled on and off, the next time I try to open it I am receiving an error that content script was already registered. Screenshot 2023-05-02 at 14 36 53 - Unregistering content scripts before attempting to register them again. We need to inject `__REACT_DEVTOOLS_GLOBAL_HOOK__` on each page, so this should be expected behaviour. - Fixed error logging ## How did you test this change? Local build of extension for Chrome, trying the same steps, which resulted in an error. No regression in performance, tested on react.dev, still the same. DiffTrain build for commit https://github.com/facebook/react/commit/8a25302c668d6f9a24f6680fb4947e9b388bb7d9. Changelog: [Internal]: << DO NOT EDIT BELOW THIS LINE >> Reviewed By: sammy-SC Differential Revision: D45532160 Pulled By: tyao1 fbshipit-source-id: d021721a4aee3e052512006f61cfdf72df56dbda --- packages/react-native/Libraries/Renderer/REVISION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/Libraries/Renderer/REVISION b/packages/react-native/Libraries/Renderer/REVISION index 80276d7ba3b..40f62ca1040 100644 --- a/packages/react-native/Libraries/Renderer/REVISION +++ b/packages/react-native/Libraries/Renderer/REVISION @@ -1 +1 @@ -2c2476834a7c739ca239750b73f74aa1df144a93 +8a25302c668d6f9a24f6680fb4947e9b388bb7d9