Skip to content
This repository has been archived by the owner on May 22, 2020. It is now read-only.

Do you support installing extra DevTools into Electron? #109

Open
sebinsua opened this issue Jul 27, 2017 · 7 comments
Open

Do you support installing extra DevTools into Electron? #109

sebinsua opened this issue Jul 27, 2017 · 7 comments

Comments

@sebinsua
Copy link

sebinsua commented Jul 27, 2017

I see no mention within the openfin documentation of tools like React DevTools and Redux DevTools. These types of tools are extremely useful for debugging modern applications. Has there been any thought into first-class support for them to improve the developer experience?

You could look into an approach like the one found in electron-devtools-installer as this might help you in coming up with a good approach for the feature.

As it stands I have to build/use standalone versions of the tools which isn't ideal.

Sorry, if I'm not meant to ask this here, but you've open-sourced so it felt like fair game! :)

@dcchuck
Copy link
Contributor

dcchuck commented Jul 27, 2017

Hey Seb,

Definitely the right place to ask! We currently don't support these devtools extensions out of the box. While it is on our radar, it's not on our short term roadmap. I'll loop back if this moves to a sprint.

Chuck Danielsson

@sebinsua
Copy link
Author

Not saying this is going to happen but do you accept contributions?

I'm tempted to fork the repo to see if I can get it to work... :)

@dcchuck
Copy link
Contributor

dcchuck commented Jul 28, 2017

Absolutely!

@sebinsua
Copy link
Author

sebinsua commented Aug 1, 2017

Hey.

I forked and played around. I can install the extensions but the extra tabs don't appear.

I think this could either be because of an older version of Electron or because of some security feature or disabled logic within Openfin. What version of Electron was openfin forked from - was it before 1.2.1? I don't believe Electron had support before then. Can you think of anything beside this which could stop it from working?

Is it possible to attach a debugger to openfin itself? I have low visibility on what Election does to load its devtools extensions.

@sebinsua
Copy link
Author

sebinsua commented Aug 8, 2017

@dcchuck Can anybody expand on how to use node inspector to debug the interaction between openfin and Electron?

As I managed to get the extensions to install correctly, I would like to try to work out what stops the tabs from appearing. It could be a lower version of Electron, but it could also be an internal setting which stops them from running.

@dcchuck
Copy link
Contributor

dcchuck commented Aug 10, 2017

Hey Seb,

V7 was forked off of 1.4.15. You can set the port for the debugger in the runtime arguments with --debug=PORT_NUMER.

As for using node-inspector, here's a wiki that covers how to set it up. In summary you:

  1. Install node-inspector
  2. Launch an OpenFin app & set --debug=5858 in the runtime arguments
  3. Run node-inspector from your command line with ELECTRON_RUN_AS_NODE=true your/path/to/runtime/openfin.exe node_modules/node-inspector/bin/inspector.js

Step 3 assumes you've installed node-inspector to your local directory

After that follow the instructions in your console & navigate to 127.0.0.1:8080/?port=5858 where you should see the inspector

@sebinsua
Copy link
Author

sebinsua commented Aug 11, 2017

Thanks for your help.

I got the debugger to work however I'm not able to work out why the installed devtools are not working. I might not understand the codebase well enough to work this out tbh.

I've noticed that renderer/chrome-api doesn't appear within the debugger and therefore never gets executed. However I unpacked openfin.asar and it's within this package, so I know it exists alongside the other Electron code. My understanding is that the DevTools extensions require various Chrome APIs to be available and it looks like the JavaScript for the tab is never executed, however the question I have is what is meant to emit CHROME_TABS_EXECUTESCRIPT and what creates the DevTools tab. The Electron code is a bit of a maze to me at the moment though...

Edit: Hm, I found out that the extensions are probably not being loaded using their manifest.json#background.scripts[] and now I've just noticed the following error message, which might explain why stuff isn't being run:

[ERROR:CONSOLE(457)] "Uncaught Error: Cannot find module '/Users/sebinsua/OpenFin/Runtime/7.53.21.6/OpenFin.app/Contents/Resources/openfin.asar/renderer/init.js'", source: module.js (457)

Need to confirm it's not due to some bad code I wrote a few weeks ago by rolling back. I already know that file exists. (It also could be environmental, since I'm on OSX at home...)

pbaize pushed a commit to pbaize/core that referenced this issue Oct 18, 2019
* RUN-3996 fixed a multi-runtime regression (HadoukenIO#109)

* Version bump to 30.2
pbaize pushed a commit to pbaize/core that referenced this issue Oct 18, 2019
* RUN-3996 fixed a multi-runtime regression (HadoukenIO#109)

* V bump.30.2 (HadoukenIO#110) (HadoukenIO#111)

* RUN-3996 fixed a multi-runtime regression (HadoukenIO#109)

* Version bump to 30.2

* RUN-3999 multi runtime tests config update (HadoukenIO#112)

* V bump.30.2 (HadoukenIO#110)

* RUN-3996 fixed a multi-runtime regression (HadoukenIO#109)

* Version bump to 30.2

* RUN-3999 Update multi runtime tests config

* Bug/run 3965 multi runtime cache clearing issue (HadoukenIO#114)

* V bump.30.2 (HadoukenIO#110)

* RUN-3996 fixed a multi-runtime regression (HadoukenIO#109)

* Version bump to 30.2

* RUN-3965 Fix EPERM: operation not permitted

* RUN-3965 Fix some cache folders not deleted issue

* RUN-4017/services (HadoukenIO#113)

* passing tests

* made changes

* RUN-4028 -  Async add listener (HadoukenIO#115)

* V bump.30.2 (HadoukenIO#110)

* RUN-3996 fixed a multi-runtime regression (HadoukenIO#109)

* Version bump to 30.2

* some test fixes

* more timeouts in tests

* altered tests to check for awaiting newlistener

* undo unnecessary edit

* fix types of registereventlistener and unregister

* hold, fixed removeAllListeners but need to test

* added some tests

* added testing

* cleanup

* fix prependonce

*  bit more testing

* revert test changes

* changed class name, some cleanup

* make tests match new best practices

* name of test file

* tests cleanup

* back to arrows for tslint

* bind rawsend (HadoukenIO#116)

* RUN-4045 register window name early in creation (HadoukenIO#117)

* RUN-4033 plugin.import accepts a string (HadoukenIO#118)

* Feature/test sledghammer (HadoukenIO#119)

* sledghammer approach to fixing tests.

* taking a sledghammer to our Multi runtime tests.

* Moving back to es6 untill we hit a major version.

* A few items from the code review.

* code review items.

* code review items.

* V bump.30.2 (HadoukenIO#110) (HadoukenIO#121)

* RUN-3996 fixed a multi-runtime regression (HadoukenIO#109)

* Version bump to 30.2

* RUN-3898 - External services tests (HadoukenIO#120)

* hiold

* hold

* tests for external services re RUN-3898

* clean up

* Test fixed, no longer leaving around runtime (HadoukenIO#122)

* test fixed, no longer leaving around runtime

* cleanup

* Fixed issue with the webpack grunt task where it was not reporting the errors correctly (HadoukenIO#123)

* Fixed issue with the webpack grunt task where it was not reporting the errors correctly

* Passing error codes instead of arrays.

* version bump. (HadoukenIO#124)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants