apache / apache/cordova-electron
ElectronSettingsFilePath settings file is ignored?
- Dominant language
- JavaScript
- Stars
- 135
- Forks
- 60
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 5
Description
# Bug Report
## Problem
I am having problems to set the app settings using the "ElectronSettingsFilePath" preference of the Cordova config.xml file.
### What is expected to happen?
What is expected is that the settings are taken from the file which is indicated in the "ElectronSettingsFilePath" preference.
### What does actually happen?
Apparently the specified settings file "ElectronSettingsFilePath" is ignored: no matter the changes that I made to this settings file, for example, changing the width and height of the window, these settings are not take in consideration when build the app.
I found a file "/platforms/electron/platform_www/cdv-electron-settings.json" which is what apparently electron is taken for the settings: certainly if I change this file settings, I can see it reflected in the build app.
## Information
I am using the Cordova config.xml to place the below XML code:
`
`
And certainly I have a "electron_settings.json" file in the same folder than the config.xml file, however, this settings file are apparently ignored / not used when build the app.
This is the content of my test settings file: not too much, in fact I only change the "width" and the "height" to see if working, but, it's not working:
{
"browserWindow": {
"width": 320,
"height": 480,
"resizable": false,
"webPreferences": {
"nodeIntegration": true
}
}
}
### Command or Code
CALL cordova platform add electron@latest
CALL cordova build electron --release
### Environment, Platform, Device
I am using Microsoft Windows 11 with the latest version of Cordova and Cordova Electron.
### Version information
Cordova CLI version: 11.0.0
Electron Builder version 22.14.13 os=10.0.22000
## 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
I appreciate any possible help with this issue. In fact I am near to assert that the config.xml file preference as well the settings file for Electron is working in the past as expected, however, I experienced this issue now and I really don't know how to proceed. So thanks very much in advance for any possible help or advice!
Contributor guide
Research direction
Start by tracing how the ElectronSettingsFilePath preference in config.xml is handled during `cordova platform add electron@latest` and `cordova build electron --release`, comparing the source electron_settings.json with the generated platform_www/cdv-electron-settings.json. Done means the specified settings file is used during the build and changes such as window width and height appear in the built app.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- electron, javascript
- Domain
- build-system, desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100