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) {
3232 } ;
3333 chrome . runtime . sendMessage ( lastDetectionResult ) ;
3434
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.
3838 } else if ( evt . data . source === 'react-devtools-inject-backend' ) {
3939 // 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+ ) ;
4144 script . src = chrome . runtime . getURL ( 'build/backend.js' ) ;
42- script . charset = " utf-8" ;
45+ script . charset = ' utf-8' ;
4346 document . documentElement . appendChild ( script ) ;
4447 script . parentNode . removeChild ( script ) ;
4548 }
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import {createElement} from 'react';
44import { unstable_createRoot as createRoot , flushSync } from 'react-dom' ;
55import Bridge from 'react-devtools-shared/src/bridge' ;
66import Store from 'react-devtools-shared/src/devtools/store' ;
7- import inject from './inject' ;
87import {
98 createViewElementSource ,
109 getBrowserName ,
@@ -136,12 +135,12 @@ function createPanelIfReactLoaded() {
136135 // Initialize the backend only once the Store has been initialized.
137136 // Otherwise the Store may miss important initial tree op codes.
138137 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 ) ;
143142 }
144- }
143+ } ,
145144 ) ;
146145
147146 const viewElementSourceFunction = createViewElementSource (
You can’t perform that action at this time.
0 commit comments