File tree Expand file tree Collapse file tree 2 files changed +13
-11
lines changed
packages/react-devtools-extensions/src Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -32,14 +32,17 @@ window.addEventListener('message', function(evt) {
32
32
} ;
33
33
chrome . runtime . sendMessage ( lastDetectionResult ) ;
34
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
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.
38
38
} else if ( evt . data . source === 'react-devtools-inject-backend' ) {
39
39
// the prototype stuff is in case document.createElement has been modified
40
- var script = document . constructor . prototype . createElement . call ( document , 'script' ) ;
40
+ const script = document . constructor . prototype . createElement . call (
41
+ document ,
42
+ 'script' ,
43
+ ) ;
41
44
script . src = chrome . runtime . getURL ( 'build/backend.js' ) ;
42
- script . charset = " utf-8" ;
45
+ script . charset = ' utf-8' ;
43
46
document . documentElement . appendChild ( script ) ;
44
47
script . parentNode . removeChild ( script ) ;
45
48
}
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import {createElement} from 'react';
4
4
import { unstable_createRoot as createRoot , flushSync } from 'react-dom' ;
5
5
import Bridge from 'react-devtools-shared/src/bridge' ;
6
6
import Store from 'react-devtools-shared/src/devtools/store' ;
7
- import inject from './inject' ;
8
7
import {
9
8
createViewElementSource ,
10
9
getBrowserName ,
@@ -136,12 +135,12 @@ function createPanelIfReactLoaded() {
136
135
// Initialize the backend only once the Store has been initialized.
137
136
// Otherwise the Store may miss important initial tree op codes.
138
137
chrome . devtools . inspectedWindow . eval (
139
- `window.postMessage({ source: 'react-devtools-inject-backend' });` ,
140
- function ( response , error ) {
141
- if ( error ) {
142
- console . log ( error ) ;
138
+ `window.postMessage({ source: 'react-devtools-inject-backend' });` ,
139
+ function ( response , evalError ) {
140
+ if ( evalError ) {
141
+ console . log ( evalError ) ;
143
142
}
144
- }
143
+ } ,
145
144
) ;
146
145
147
146
const viewElementSourceFunction = createViewElementSource (
You can’t perform that action at this time.
0 commit comments