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 — Moved backend injection logic to content script · react/react@788036c

File tree

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

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

Copy file name to clipboardExpand all lines: packages/react-devtools-extensions/src/inject.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
export default function inject(scriptName: string, done: ? Function) {
44
const source = `
55
(function () {
6-
window.postMessage({ source: 'react-devtools-inject-backend', type: "FROM_PAGE", text: "Hello from the webpage!" }, "*");
6+
window.postMessage({ source: 'react-devtools-inject-script', scriptName: "${scriptName}" }, "*");
77
})()
88
`;
99

Collapse file

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

Copy file name to clipboardExpand all lines: packages/react-devtools-extensions/src/injectGlobalHook.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ window.addEventListener('message', function(evt) {
3737
reactBuildType: evt.data.reactBuildType,
3838
};
3939
chrome.runtime.sendMessage(lastDetectionResult);
40-
} else if (evt.data.source === 'react-devtools-inject-backend') {
40+
} else if (evt.data.source === 'react-devtools-inject-backend' && evt.data.scriptName) {
4141
//Inject backend
4242
var script = document.constructor.prototype.createElement.call(document, 'script');
43-
script.src = chrome.runtime.getURL('build/backend.js');
43+
script.src = evt.data.scriptName;
4444
script.charset = "utf-8";
4545
document.documentElement.appendChild(script);
4646
script.parentNode.removeChild(script);
@@ -97,4 +97,4 @@ if (sessionStorageGetItem(SESSION_STORAGE_RELOAD_AND_PROFILE_KEY) === 'true') {
9797
// devtools are installed (and skip its suggestion to install the devtools).
9898
injectCode(
9999
';(' + installHook.toString() + '(window))' + saveNativeValues + detectReact,
100-
);
100+
);

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.