Removed done(), added some comments explaining the change

This commit is contained in:
Stephanie Ding
2019-09-11 08:05:27 -07:00
parent 8a6cd3cd12
commit 2e75000f40
2 changed files with 8 additions and 8 deletions
+5 -1
View File
@@ -31,8 +31,12 @@ window.addEventListener('message', function(evt) {
reactBuildType: evt.data.reactBuildType,
};
chrome.runtime.sendMessage(lastDetectionResult);
// Inject the backend. This is done in the content script to avoid CSP
// and Trusted Types violations, since content scripts can modify the DOM
// and are not subject to the page's policies
} else if (evt.data.source === 'react-devtools-inject-backend') {
//Inject the specified script
// the prototype stuff is in case document.createElement has been modified
var script = document.constructor.prototype.createElement.call(document, 'script');
script.src = chrome.runtime.getURL('build/backend.js');
script.charset = "utf-8";
+3 -7
View File
@@ -138,14 +138,10 @@ function createPanelIfReactLoaded() {
chrome.devtools.inspectedWindow.eval(
`window.postMessage({ source: 'react-devtools-inject-backend' });`,
function(response, error) {
if (error) {
console.log(error);
if (error) {
console.log(error);
}
}
if (typeof done === 'function') {
done();
}
}
);
const viewElementSourceFunction = createViewElementSource(