Skip to content

Commit

Permalink
DevTools: Fix passing extensionId in evaled postMessage calls (#22590)
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan authored Oct 19, 2021
1 parent 02f4115 commit fe0356c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions packages/react-devtools-extensions/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ function createPanelIfReactLoaded() {
chrome.devtools.inspectedWindow.eval(
`window.postMessage({
source: 'react-devtools-inject-backend',
extensionId: "${CURRENT_EXTENSION_ID}"
extensionId: "${CURRENT_EXTENSION_ID}",
}, '*');`,
function(response, evalError) {
if (evalError) {
Expand Down Expand Up @@ -361,15 +361,15 @@ function createPanelIfReactLoaded() {
chrome.runtime.onMessage.addListener(onPortMessage);

chrome.devtools.inspectedWindow.eval(`
window.postMessage({
source: 'react-devtools-extension',
extensionId: "${CURRENT_EXTENSION_ID}"
payload: {
type: 'fetch-file-with-cache',
url: "${url}",
},
});
`);
window.postMessage({
source: 'react-devtools-extension',
extensionId: "${CURRENT_EXTENSION_ID}",
payload: {
type: 'fetch-file-with-cache',
url: "${url}",
},
}, '*');
`);
};

// Fetching files from the extension won't make use of the network cache
Expand Down

0 comments on commit fe0356c

Please sign in to comment.