/**
 * Install the hook on window, which is an event emitter.
 * Note because Chrome content scripts cannot directly modify the window object,
 * we are evaling this function by inserting a script tag.
 * That's why we have to inline the whole event emitter implementation here.
 *
 * @flow
 */
import {
  patch as patchConsole,
  registerRenderer as registerRendererWithConsole,
} from './backend/console';
import type {DevToolsHook} from 'react-devtools-shared/src/backend/types';
declare var window: any;
export function installHook(target: any): DevToolsHook | null {
  if (target.hasOwnProperty('__REACT_DEVTOOLS_GLOBAL_HOOK__')) {
    return null;
  }
  function detectReactBuildType(renderer) {
    try {
      if (typeof renderer.version === 'string') {
        
        if (renderer.bundleType > 0) {
          
          
          
          return 'development';
        }