Skip to content

Commit

Permalink
DevTools: Fix passing extensionId in evaled postMessage calls (facebo…
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan authored and zhengjitf committed Apr 15, 2022
1 parent 1e39627 commit b38bab0
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 b38bab0

Please sign in to comment.