Skip to content

addDevToolsExtension does not work in Electron v0.30.2 #2404

Closed

Description

@s-a

Code to reproduce:

    var dir = path.join(__dirname, "chrome-devtools-zerodarkmatrix-theme","theme-extension" );
    var ext = require('remote').require('browser-window').addDevToolsExtension(dir);

In electron: "0.26.1" it looks like this 👍

image

ref:s-a/iron-node#28

Activity

  1. hanzhao commented on Aug 2, 2015

    @hanzhao
    Contributor

    v0.30.0 reproduced

  2. s-a commented on Aug 3, 2015

    @s-a
    Author

    @zcbenz does there exist a way to subscribe a notification if a new electron version was released?

  3. deepak1556 commented on Aug 3, 2015

    @deepak1556
    Member

    @s-a you need to enable Allow Custom UI themes option in experiments panel of devtools for this extension to work.

  4. zcbenz commented on Aug 3, 2015

    @zcbenz
    Contributor
  5. s-a commented on Aug 3, 2015

    @s-a
    Author

    @deepak1556 This is already activated.

    @zcbenz ty 😄

  6. deepak1556 commented on Aug 3, 2015

    @deepak1556
    Member

    just tested on linux and works fine.

    screenshot from 2015-08-03 16-44-17

  7. s-a commented on Aug 3, 2015

    @s-a
    Author

    Hmm nice to know that Linux is not affected 👍 @magicae What OS are you using? I am on Windows 7 here. Would be cool to know if it works on mac.

  8. hanzhao commented on Aug 3, 2015

    @hanzhao
    Contributor

    @s-a I use Linux and I can't add React DevTool to Electron devtool.

  9. deepak1556 commented on Aug 3, 2015

    @deepak1556
    Member

    Really not sure this is a OS specific issue, only two things that can go wrong here would be path to extension might be incorrect or the custom experiments options isnt set before loading extension. @s-a could you try remote-debugging the devtools to see if extension is loaded ?

    @magicae react devtools needs loading content scripts support in Electron.

  10. s-a commented on Aug 3, 2015

    @s-a
    Author

    @deepak1556 yes i am able to debug remote. But not far enough into electron to know how. Can you post me debugger expression I should check?

  11. s-a commented on Aug 3, 2015

    @s-a
    Author

    The fact my code works on v"0.26.1" indicates it is a timing problem then.
    I' ve tested this without success.

        setTimeout(function() {
            debugger;
            var dir = path.join(__dirname, "chrome-devtools-zerodarkmatrix-theme","theme-extension" );
            var ext = require('remote').require('browser-window').addDevToolsExtension(dir);
            console.info("loaded dev-tools-extension", "chrome-devtools-zerodarkmatrix-theme", ext);
        }, 3000)
  12. hanzhao commented on Aug 3, 2015

    @hanzhao
    Contributor

    @magicae react devtools needs loading content scripts support in Electron.

    @deepak1556 is it supported now? I can't find it and can't load React DevTools...

  13. deepak1556 commented on Aug 3, 2015

    @deepak1556
    Member

    @magicae nope. tracked here #915

    @s-a you can check for the stack trace at InspectorFrontEndAPI.addExtensions in devtools.js.

  14. 2 remaining items

  15. s-a commented on Aug 4, 2015

    @s-a
    Author

    @deepak1556 To be shure we talk about the same status i created a repo to reproduce at https://github.com/s-a/e-d-t-e-t

    git clone https://github.com/s-a/e-d-t-e-t.git;
    cd e-d-t-e-t;
    git submodule update --init --recursive
    npm install;
    npm run dev;
  16. deepak1556 commented on Aug 4, 2015

    @deepak1556
    Member

    @s-a thanks for the test case, these are the two things i had to change to make the extension work.

    • Enable Allow Custom UI themes options
    • load the page after devtools-opened
        mainWindow.on('devtools-opened', function() {
            mainWindow.loadUrl('file://' + __dirname + '/index.html');
        })
    
  17. s-a commented on Aug 4, 2015

    @s-a
    Author

    Unfortunately extension still does not work on my workstation. Additional I tried Restore defaults and reload
    image

    Restarted the app re-checked Allow Custom UI themes and re-started again.
    Without success.

    I will give it a try on Ubuntu today. There I should have exactly the same environment conditions than you.

    Updated test case code at https://github.com/s-a/e-d-t-e-t/commit/81900e8df0e9fd92d0f8a0df7d1d69ffcecff2d7

  18. s-a commented on Aug 4, 2015

    @s-a
    Author

    No success on Ubuntu

    $ lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 14.04.2 LTS
    Release:    14.04
    Codename:   trusty

    If I pass a wrong extension folder it throws an exception.

    What is your secret @deepak1556? 👿

  19. deepak1556 commented on Aug 5, 2015

    @deepak1556
    Member

    @s-a was able to reproduce the issue, could try the following in your test demo and confirm the result.

    • Run the test demo and enable the Allow Custom Ui option.
    • Remove the extension and add (try in devtools console / in app run after devtools-opened with a delay).

    The problem is when we load the registered extensions on devtools open here, the experiments option isnt recognised by the time it loads and hence dont find the theme applied, a slight delay in loading the extension after devtools opened produces the desired result. I still havnt figured how devtools applies the experiments option.

  20. s-a commented on Aug 5, 2015

    @s-a
    Author

    I commented all code from app.js so that it is empty.
    Double checked that Allow Custom Ui option is enabled.

    Then I executed this in the console after some seconds

    var path= require("path");
    var dir = path.join(__dirname, "..", "chrome-devtools-zerodarkmatrix-theme","theme-extension" );
    var ext = require('remote').require('browser-window').removeDevToolsExtension(dir);
    console.log(ext);
    setTimeout(function(){
    ext = require('remote').require('browser-window').addDevToolsExtension(dir);
    console.log(ext);}, 5000);
    VM114:5 true
    1
    VM114:8 undefined

    removeDevToolsExtension returns true, while addDevToolsExtension returns undefined. 😿

  21. deepak1556 commented on Aug 5, 2015

    @deepak1556
    Member

    removeDevToolsExtension uses the extension name from manifest not the path to the extension. It should be removeDevToolsExtension("DevTools Theme: Zero Dark Matrix")

  22. s-a commented on Aug 5, 2015

    @s-a
    Author

    Success!!! 🙀 😄 👍

  23. s-a commented on Aug 5, 2015

    @s-a
    Author

    It simply works even without a timeout.

  24. gouthamve commented on Aug 19, 2015

    @gouthamve

    I am getting a ENOENT error for react devtools. Its trying to open manifest.json which doesn't exist for react dev-tools

    '/Users/goutham/github/bookworm/react-devtools/manifest.json'
    Error: ENOENT: no such file or directory, open '/Users/goutham/github/bookworm/react-devtools/manifest.json'
    
  25. s-a commented on Aug 26, 2015

    @s-a
    Author

    @deepak1556 since v0.31.0 your work around does not work anymore 😢

  26. s-a commented on Dec 12, 2015

    @s-a
    Author

    @deepak1556 seems that this is broken again in electron 0.36.0 ?

  27. s-a commented on Dec 12, 2015

    @s-a
    Author

    no it works! sorry i missed the option in allow custom ui

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions