Skip to content

Commit ea50bc3

Browse files
author
Juan Tejada
committed
Make sure to pass the extension ID to all postMessages handled by injectGlobalHook
1 parent 8624a5c commit ea50bc3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/react-devtools-extensions/src/injectGlobalHook.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ window.__REACT_DEVTOOLS_GLOBAL_HOOK__.on('renderer', function({reactBuildType})
116116
window.postMessage({
117117
source: 'react-devtools-detector',
118118
reactBuildType,
119+
extensionId: "${CURRENT_EXTENSION_ID}",
119120
}, '*');
120121
});
121122
`;

packages/react-devtools-extensions/src/main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,10 @@ function createPanelIfReactLoaded() {
217217
// Initialize the backend only once the Store has been initialized.
218218
// Otherwise the Store may miss important initial tree op codes.
219219
chrome.devtools.inspectedWindow.eval(
220-
`window.postMessage({ source: 'react-devtools-inject-backend', extensionId: "${CURRENT_EXTENSION_ID}" }, '*');`,
220+
`window.postMessage({
221+
source: 'react-devtools-inject-backend',
222+
extensionId: "${CURRENT_EXTENSION_ID}"
223+
}, '*');`,
221224
function(response, evalError) {
222225
if (evalError) {
223226
console.error(evalError);
@@ -363,6 +366,7 @@ function createPanelIfReactLoaded() {
363366
chrome.devtools.inspectedWindow.eval(`
364367
window.postMessage({
365368
source: 'react-devtools-extension',
369+
extensionId: "${CURRENT_EXTENSION_ID}"
366370
payload: {
367371
type: 'fetch-file-with-cache',
368372
url: "${url}",

0 commit comments

Comments
 (0)