You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix[dynamic-scripts-injection]: unregister content scripts before registration (#26765)
## 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.
<img width="676" alt="Screenshot 2023-05-02 at 14 36 53"
src="https://user-images.githubusercontent.com/28902667/235877692-51c5d284-79d9-4b00-b62e-d25d5bb5e056.png">
- 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 8a25302.
Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -23918,7 +23918,7 @@ function createFiberRoot(
23918
23918
return root;
23919
23919
}
23920
23920
23921
-
var ReactVersion = "18.3.0-canary-2c2476834-20230503";
23921
+
var ReactVersion = "18.3.0-canary-8a25302c6-20230503";
Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -8623,7 +8623,7 @@ var devToolsConfig$jscomp$inline_1039 = {
8623
8623
throwError("TestRenderer does not support findFiberByHostInstance()");
8624
8624
},
8625
8625
bundleType: 0,
8626
-
version: "18.3.0-canary-2c2476834-20230503",
8626
+
version: "18.3.0-canary-8a25302c6-20230503",
8627
8627
rendererPackageName: "react-test-renderer"
8628
8628
};
8629
8629
varinternals$jscomp$inline_1238={
@@ -8654,7 +8654,7 @@ var internals$jscomp$inline_1238 = {
Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -9049,7 +9049,7 @@ var devToolsConfig$jscomp$inline_1081 = {
9049
9049
throwError("TestRenderer does not support findFiberByHostInstance()");
9050
9050
},
9051
9051
bundleType: 0,
9052
-
version: "18.3.0-canary-2c2476834-20230503",
9052
+
version: "18.3.0-canary-8a25302c6-20230503",
9053
9053
rendererPackageName: "react-test-renderer"
9054
9054
};
9055
9055
varinternals$jscomp$inline_1279={
@@ -9080,7 +9080,7 @@ var internals$jscomp$inline_1279 = {
0 commit comments