Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DevTools: Fix passing extensionId in evaled postMessage calls #22590

Merged
merged 1 commit into from
Oct 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤮

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