abhijithvijayan / web-extension-starter

🖥🔋Web Extension starter to build "Write Once Run on Any Browser" extension
MIT License
2.03k stars 172 forks source link

use with react devtools? #51

Closed Gvozd closed 4 years ago

Gvozd commented 4 years ago

In сhrome, extensions not working on extension page(e.g. options.html) And i dont know a way to make them work

How do you use React Devtools? Is there some easy way?

I'm trying to use react-devtools-inline for now, and I will share the solution later, if there are no simpler/convenient solutions

abhijithvijayan commented 4 years ago

What do you mean by extensions are not working on options page?

Gvozd commented 4 years ago

In Chrome

  1. I install react devtools extension https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi
  2. Go to chrome-extension://poejihmdinohpgnbcpfidehmnnakjkfn/options.html of developed extension
  3. F12 - has no react devtool tabs in chrome devtools
Gvozd commented 4 years ago

@abhijithvijayan Do you have any ideas how to use react devtools for debug plugin?

abhijithvijayan commented 4 years ago

Let me check it out

abhijithvijayan commented 4 years ago

@Gvozd I have looked into the issue and noticed that it is due to restrictions put by the browser. So you have to run standalone version of dev tools and use it instead.

Solution:

ref: https://www.npmjs.com/package/react-devtools#usage-with-react-dom

abhijithvijayan commented 4 years ago

Closing for now. feel free to reopen if issue still persist.

abhijithvijayan commented 4 years ago

@Gvozd did it work for you?

Gvozd commented 4 years ago

@abhijithvijayan yes, it works, but not fully It lacks an item selection button on the page, and navigation to the source code of the component image

I experimented with the react-devtools-inline, and opening it in another tab In this case "select an element" worked But this module requierd experimental versions of react/react-dom But this problem can be solved

But it is still less convenient than debugging with an extension, as for regular sites.

abhijithvijayan commented 2 years ago

updated the answer here to use a custom webpack plugin i wrote now. works fine in my project.