GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Removed done(), added some comments explaining the change · react/react@2e75000

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/react-devtools-extensions/src
    • injectGlobalHook.js
    • main.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-devtools-extensions/src/injectGlobalHook.js‎

Copy file name to clipboardExpand all lines: packages/react-devtools-extensions/src/injectGlobalHook.js
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,12 @@ window.addEventListener('message', function(evt) {
3131
reactBuildType: evt.data.reactBuildType,
3232
};
3333
chrome.runtime.sendMessage(lastDetectionResult);
34+
35+
// Inject the backend. This is done in the content script to avoid CSP
36+
// and Trusted Types violations, since content scripts can modify the DOM
37+
// and are not subject to the page's policies
3438
} else if (evt.data.source === 'react-devtools-inject-backend') {
35-
//Inject the specified script
39+
// the prototype stuff is in case document.createElement has been modified
3640
var script = document.constructor.prototype.createElement.call(document, 'script');
3741
script.src = chrome.runtime.getURL('build/backend.js');
3842
script.charset = "utf-8";
Collapse file

‎packages/react-devtools-extensions/src/main.js‎

Copy file name to clipboardExpand all lines: packages/react-devtools-extensions/src/main.js
+3-7Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,10 @@ function createPanelIfReactLoaded() {
138138
chrome.devtools.inspectedWindow.eval(
139139
`window.postMessage({ source: 'react-devtools-inject-backend' });`,
140140
function(response, error) {
141-
if (error) {
142-
console.log(error);
143-
}
144-
145-
if (typeof done === 'function') {
146-
done();
141+
if (error) {
142+
console.log(error);
143+
}
147144
}
148-
}
149145
);
150146

151147
const viewElementSourceFunction = createViewElementSource(

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.