Skip to content

Commit 85c7211

Browse files
committed
Moved injection logic to content script
1 parent 788036c commit 85c7211

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* global chrome */
22

3-
export default function inject(scriptName: string, done: ? Function) {
3+
export default function inject(scriptName: string, done: ?Function) {
44
const source = `
55
(function () {
66
window.postMessage({ source: 'react-devtools-inject-script', scriptName: "${scriptName}" }, "*");

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ 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' && evt.data.scriptName) {
41-
//Inject backend
40+
} else if (evt.data.source === 'react-devtools-inject-script' && evt.data.scriptName) {
41+
//Inject the specified script
4242
var script = document.constructor.prototype.createElement.call(document, 'script');
4343
script.src = evt.data.scriptName;
4444
script.charset = "utf-8";

0 commit comments

Comments
 (0)