-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the config.xml path in the XHR load eventListener #42
Conversation
@jackvz I have also seen this issue and been played around with the same changes you applied in this PR. I believe these changes will be OK. Have you tested your changes with following:
Also, this has nothing to do with Ionic specifically. This is about the normal process for loading Cordova's Can you update the title and description to be more accurate to the problem so that other users will understand that its more around the cordova plugin usage and not Ionic. |
Hi @erisu. Thanks for checking. Right, I have updated the title and description. Yes, I have now tested it by building and running with Cordova, and it's working as expected. |
Codecov Report
@@ Coverage Diff @@
## master #42 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 14 14
Lines 568 568
=====================================
Hits 568 568 Continue to review full report at Codecov.
|
Hi @erisu and all. How does this work? This actually solves the issue for me, not only in Ionic but more importantly also in pure Cordova. Not sure if this is set up like it is currently because of some other integration, and in that case I am happy to use my fork. Please let me know if there is anything else for me to do about this pull request. Happy Friday! |
@jackvz I will run a few tests against your PR and make sure that there was no missing use case that I wasn't thinking about. If all is good, I will try to merge into master this coming week. As for the patch release timeline, I can't give an exact date as of yet. There are a few things I want to check before release. |
Sounds good @erisu, thanks. No rush. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve run a few tests. Config.xml
loads correctly. However, the splash screen for browser and electron only works when the images are in the {project_root}/www/
folder, but if you build for other platforms, you might not want your splash screen to reside in the{project_root}/www/
. We’re looking for a possible solution.
Other than that, this PR looks good to me. I just feel that the PR message could be more accurate. Something like “Correctly load the config.xml” or “Update the config.xml path in the xhr load eventListener”.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @erisu
@GedasGa I get that, and I'm not sure what the best solution is. I'm still getting my head around Cordova. The image need not be in the root. Here is a demo of how the splash screen image is in a resources folder in root. I did have to copy the splash image and config.xml file to make it work for both the Electron and Browser targets, but I believe we can use Cordova Hook scripts for that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Platforms affected
I am using macOS Mojave, but I think this should affect Windows and Linux as well. This is a fix for the Electron platform in Cordova.
Motivation and Context
This makes the configuration settings in config.xml work when targeting the Electron platform when running Cordova.
I am specifically working with the Splashscreen Cordova plugin and the settings were not loading when Cordova targeting Electron, like this:
cordova run electron --livereload
The settings I tried to pull in is in the root of my project in config.xml:
Description
I changed cordova-js-src/confighelper.js and cordova-lib/cordova.js to load config.xml from the relative location and not the root. (I just removed the "/" in front of config.xml.)
Testing
Ran all tests.
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)