Skip to content

Commit

Permalink
Moved inline comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
bvaughn committed Sep 11, 2019
1 parent 776d1c6 commit f09854a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/react-devtools-extensions/src/injectGlobalHook.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit f09854a

Please sign in to comment.