Support User Defined Electron Settings #38
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Platforms affected
electron
Motivation and Context
Provide a way to allow users to modify the Cordova Electron Settings file.
Description
This PR allows users to create a file that will be merged with the defaults and and written to the staging area.
The user can create and place the file anywhere from within the project directory and then provides the link within
config.xml
Example:
This file does not have any filename restrictions.
It will be fetched and merged on top of the Cordova defaults.
Example:
Cordova Defaults are:
If the user would like to support Node.JS and Electron APIs, the developer can create a new file with
Testing
npm t
Test Case Nightly
CDVEletronSettings Override Test Case 1
Created
res/electron/settings.json
with content:Updated
config.xml
with content:Expected: Larger Size and Open devTools
Result: Pass
CDVEletronSettings Override Test Case 2
Created
res/electron/settings.json
with content:Updated
config.xml
with content:Expected: Large Size, nodeIntegration Warning, devTools open as command overrides this setting.
Result: Pass
Test Case Latest (8.x)
CDVEletronSettings Override Test Case 1
Created
res/electron/settings.json
with content:Updated
config.xml
with content:Expected: Larger Size and Open devTools
Result: Pass
CDVEletronSettings Override Test Case 2
Created
res/electron/settings.json
with content:Updated
config.xml
with content:Expected: Large Size, nodeIntegration Warning, devTools open as command overrides this setting.
Result: Pass
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)