From f09854a9e85cb612f26172f6ea1dea0b3de45aec Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Wed, 11 Sep 2019 09:30:57 -0700 Subject: [PATCH] Moved inline comment. --- .../react-devtools-extensions/src/injectGlobalHook.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/react-devtools-extensions/src/injectGlobalHook.js b/packages/react-devtools-extensions/src/injectGlobalHook.js index ca4acfcbd50c4..2347671d24a5a 100644 --- a/packages/react-devtools-extensions/src/injectGlobalHook.js +++ b/packages/react-devtools-extensions/src/injectGlobalHook.js @@ -31,12 +31,10 @@ 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') { - // the prototype stuff is in case document.createElement has been modified + // The backend is injected by 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. + // The prototype stuff is in case document.createElement has been modified. const script = document.constructor.prototype.createElement.call( document, 'script',