Skip to content

Commit 13a4471

Browse files
committed
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.
1 parent ba4ef65 commit 13a4471

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23918,7 +23918,7 @@ function createFiberRoot(
2391823918
return root;
2391923919
}
2392023920

23921-
var ReactVersion = "18.3.0-canary-2c2476834-20230503";
23921+
var ReactVersion = "18.3.0-canary-8a25302c6-20230503";
2392223922

2392323923
// Might add PROFILE later.
2392423924

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8623,7 +8623,7 @@ var devToolsConfig$jscomp$inline_1039 = {
86238623
throw Error("TestRenderer does not support findFiberByHostInstance()");
86248624
},
86258625
bundleType: 0,
8626-
version: "18.3.0-canary-2c2476834-20230503",
8626+
version: "18.3.0-canary-8a25302c6-20230503",
86278627
rendererPackageName: "react-test-renderer"
86288628
};
86298629
var internals$jscomp$inline_1238 = {
@@ -8654,7 +8654,7 @@ var internals$jscomp$inline_1238 = {
86548654
scheduleRoot: null,
86558655
setRefreshHandler: null,
86568656
getCurrentFiber: null,
8657-
reconcilerVersion: "18.3.0-canary-2c2476834-20230503"
8657+
reconcilerVersion: "18.3.0-canary-8a25302c6-20230503"
86588658
};
86598659
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
86608660
var hook$jscomp$inline_1239 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9049,7 +9049,7 @@ var devToolsConfig$jscomp$inline_1081 = {
90499049
throw Error("TestRenderer does not support findFiberByHostInstance()");
90509050
},
90519051
bundleType: 0,
9052-
version: "18.3.0-canary-2c2476834-20230503",
9052+
version: "18.3.0-canary-8a25302c6-20230503",
90539053
rendererPackageName: "react-test-renderer"
90549054
};
90559055
var internals$jscomp$inline_1279 = {
@@ -9080,7 +9080,7 @@ var internals$jscomp$inline_1279 = {
90809080
scheduleRoot: null,
90819081
setRefreshHandler: null,
90829082
getCurrentFiber: null,
9083-
reconcilerVersion: "18.3.0-canary-2c2476834-20230503"
9083+
reconcilerVersion: "18.3.0-canary-8a25302c6-20230503"
90849084
};
90859085
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
90869086
var hook$jscomp$inline_1280 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (
2727
}
2828
"use strict";
2929

30-
var ReactVersion = "18.3.0-canary-2c2476834-20230503";
30+
var ReactVersion = "18.3.0-canary-8a25302c6-20230503";
3131

3232
// ATTENTION
3333
// When adding new symbols to this file,

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,4 +645,4 @@ exports.useSyncExternalStore = function (
645645
);
646646
};
647647
exports.useTransition = useTransition;
648-
exports.version = "18.3.0-canary-2c2476834-20230503";
648+
exports.version = "18.3.0-canary-8a25302c6-20230503";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ exports.useSyncExternalStore = function (
648648
);
649649
};
650650
exports.useTransition = useTransition;
651-
exports.version = "18.3.0-canary-2c2476834-20230503";
651+
exports.version = "18.3.0-canary-8a25302c6-20230503";
652652

653653
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
654654
if (
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2c2476834a7c739ca239750b73f74aa1df144a93
1+
8a25302c668d6f9a24f6680fb4947e9b388bb7d9

0 commit comments

Comments
 (0)