-
Notifications
You must be signed in to change notification settings - Fork 466
current root path predefined variable #202
Comments
Here is the solution which I'm currently using: function absScriptLoc(filename) {
var scriptElements = document.getElementsByTagName('script');
for (var i = 0; i < scriptElements.length; i++) {
var source = scriptElements[i].src;
if (source.indexOf(filename) > -1) {
var location = source.substring(0, source.indexOf(filename)) + filename;
return location;
}
}
return false;
}
var myAbsScriptLoc = absScriptLoc('chcp.js');
var myAbsRootPath = myAbsScriptLoc.replace("plugins/cordova-hot-code-push-plugin/www/chcp.js", ""); ``` |
Thanks for the suggestion! Have you tried to load assets by relative path instead of full path? Also, if assets are not in manifest - I think you can load them from the bundled assets. |
yes, I tried everything!
They are in manifest as I'm currently updating whole app with chcp. I think I will use your suggestion to bundle most of the assets in future, to save space, thanks. |
👋 Hi! Thank you for your interest in this repo. 😢 We are not using nordnet/cordova-hot-code-push anymore, and we lack the manpower and the experience needed to maintain it. We are aware of the inconveniece that this may cause you. Feel free to use it as is, or create your own fork. 🔒 This will now be closed & locked. ℹ️ Please see #371 for more information. |
It would be great to have a predefined variable with current application root path, so it can be used for loading assets with javascript, like cordova plugin file does.
This #170 pull request introduces a method to get current version name, it would be nice if you could extend it.
The text was updated successfully, but these errors were encountered: