0

I'm working on a chrome extension popup that uses inferno. So far, my inferno components themselves are rendering just fine in the popup, so inferno itself is working.

I installed inferno-devtools in my dependencies.

manifest.json:

{
  "name": "Workflow",
  "manifest_version": 2,
  "browser_action": {
    "name": "Workflow",
    "default_popup": "/index.html"
  },
  "permissions":["tabs", "storage", "*://example.com/*" ]
}

index.html has <div id="root"></div> in the body and a <script> tag that loads the js.

In my main js file I have the following:

import Inferno from 'inferno'
... // other imports
require('inferno-devtools')

// redux store code

Inferno.render(
  <Provider store={store}>
    <WorkflowApp />
  </Provider>,
  document.getElementById('root')
)

<WorkflowApp /> can be any connected inferno functional component (via inferno-redux's connect method). This is all rendering fine in the popup and is arbitrary, so I'm omitting it here.

The problem: in Chrome devtools I do not see the React tab showing up. I have a separate React-based application that I use the React devtools on where it shows up just fine, so it's installed and working well.

Is there something specific I need to do to get it to work with inferno in a Chrome extension?

jinglesthula
  • 4,446
  • 4
  • 45
  • 79
  • Please [edit] the question to be on-topic: include a [mcve] that duplicates the problem. For Chrome extensions or Firefox WebExtensions this almost always means including your *manifest.json* and some of the background, content, and/or popup scripts/HTML. Questions seeking debugging help ("why isn't this code working the way I want?") must include: (1) the desired behavior, (2) a specific problem or error and (3) the shortest code necessary to reproduce it *in the question itself*. Please also see: [What topics can I ask about here?](http://stackoverflow.com/help/on-topic), and [ask]. – Makyen Mar 16 '17 at 23:55
  • @Makyen - I've added code to make the question more complete. Let me know if there's anything specific still needed. – jinglesthula Mar 17 '17 at 16:41

1 Answers1

0

You got to just run imported init function like this: require('inferno-devtools').initDevTools() or

import { initDevTools } from 'inferno-devtools';
initDevTools();
Bogdan Slovyagin
  • 1,109
  • 1
  • 9
  • 23