question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cdv-electron-settings.json ignored

See original GitHub issue

Bug Report

Maybe I misunderstood something, but no matter what I change in :

platform_www/cdv-electron-settings.json

e.g.:

{
    "browserWindow": {
        "height": 600,
        "webPreferences":{
            "devTools": false,
            "nodeIntegration": false
        },
        "width": 1000
    }
}

the command

cordova run electron

always uses it’s default values (and thus shows devtools). I can only avoid that, if I comment the line mainWindow.webContents.openDevTools(); in index.js

Am I missing something, or is this a bug?

Version information

Cordova 9.0.0 MacOS 10.14.4 node v11.7.0

Checklist

  • [x ] I searched for existing GitHub issues
  • [x ] I updated all Cordova tooling to most recent version
  • [x ] I included all the necessary information above

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
GedasGacommented, Apr 12, 2019

I don’t think it’s gonna be swapped. The debug build is typically meant for debugging and it’s expected that users are probably going to use the Dev Tools. Plus, we use the same flags across other platforms in Cordova too.

You might be looking at the old documentation. To disable the build process you should use --nobuild flag.

cordova run electron --nobuild

Please, refer to the Cordova documentation.

1reaction
GedasGacommented, Apr 12, 2019

We do not recommend modifying any files in the platform/ directory. Normally, the platform directory should never be committed to any versioning control service. Modifying will make platform upgrades impossible.

If you want to change the Electron’s browserWindow settings, we expect you to create a JSON file anywhere in a folder that is safe to be versioned, for example, res/electron, and then define the ElectronSettingsFilePath preference option to the config.xml file.

    <platform name="electron">
        <preference name="ElectronSettingsFilePath" value="res/electron/settings.json" />
    </platform>

However, with regards to the devTools option, we do not accept the user define value. This option is overridden by the Cordova CLI flag --debug (default) or --release.

If you do not want the Dev Tools visible, build or run with the --release flag.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Electron Platform Guide - Apache Cordova
Electron Platform Guide. Electron is a framework that uses web technologies (HTML, CSS, and JS) to build cross-platform desktop applications.
Read more >
Cordova Electron
Electron is a framework that uses web technologies (HTML, CSS, and JS) to build cross-platform desktop applications. Cordova Electron. System Requirements.
Read more >
electron-store - npm
This module handles that for you, so you can focus on building your app. The data is saved in a JSON file named...
Read more >
Update json file with Environment Variable - Compiling ENV ...
That way, we can just inject ENV that are set in the CI/CD tool into the json dynamically according to build pipeline. First,...
Read more >
Can Visual Studio Code be configured to launch electron
json points to. Using the configuration below in my launch.json file, pressing F5 both launched Electron with my app and connected the debugger ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found