Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
onionymous committed Sep 11, 2019
1 parent 2e75000 commit 776d1c6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
13 changes: 8 additions & 5 deletions packages/react-devtools-extensions/src/injectGlobalHook.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,17 @@ window.addEventListener('message', function(evt) {
};
chrome.runtime.sendMessage(lastDetectionResult);

// Inject the backend. This is done in the content script to avoid CSP
// and Trusted Types violations, since content scripts can modify the DOM
// and are not subject to the page's policies
// Inject the backend. This is done in the content script to avoid CSP
// and Trusted Types violations, since content scripts can modify the DOM
// and are not subject to the page's policies.
} else if (evt.data.source === 'react-devtools-inject-backend') {
// the prototype stuff is in case document.createElement has been modified
var script = document.constructor.prototype.createElement.call(document, 'script');
const script = document.constructor.prototype.createElement.call(
document,
'script',
);
script.src = chrome.runtime.getURL('build/backend.js');
script.charset = "utf-8";
script.charset = 'utf-8';
document.documentElement.appendChild(script);
script.parentNode.removeChild(script);
}
Expand Down
11 changes: 5 additions & 6 deletions packages/react-devtools-extensions/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {createElement} from 'react';
import {unstable_createRoot as createRoot, flushSync} from 'react-dom';
import Bridge from 'react-devtools-shared/src/bridge';
import Store from 'react-devtools-shared/src/devtools/store';
import inject from './inject';
import {
createViewElementSource,
getBrowserName,
Expand Down Expand Up @@ -136,12 +135,12 @@ function createPanelIfReactLoaded() {
// Initialize the backend only once the Store has been initialized.
// Otherwise the Store may miss important initial tree op codes.
chrome.devtools.inspectedWindow.eval(
`window.postMessage({ source: 'react-devtools-inject-backend' });`,
function(response, error) {
if (error) {
console.log(error);
`window.postMessage({ source: 'react-devtools-inject-backend' });`,
function(response, evalError) {
if (evalError) {
console.log(evalError);
}
}
},
);

const viewElementSourceFunction = createViewElementSource(
Expand Down

0 comments on commit 776d1c6

Please sign in to comment.