Update apps.js

This commit is contained in:
frju365 2018-08-30 18:04:09 +02:00 committed by GitHub
parent a9d55004f0
commit b0b9a59b9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -461,6 +461,7 @@
// Force trailing slash
params.app = params.app.replace(/\/?$/, '/');
var rawpath = "";
var giturl = params.app;
if(function() {
var xhr_object = new XMLHttpRequest();
xhr_object.open("GET", params.app + "raw/master/manifest.json", false);
@ -468,11 +469,11 @@
return xhr_object.status;
} === 200) {
rawpath = 'raw/master/manifest.json';
var giturl = params.app + rawpath;
giturl = params.app + rawpath;
} // Install custom app from github
else if (params.app.indexOf("github.com") !== -1) {
rawpath = 'master/manifest.json';
var giturl = params.app.replace('github.com', 'raw.githubusercontent.com') + rawpath;
giturl = params.app.replace('github.com', 'raw.githubusercontent.com') + rawpath;
}
else {
console.log("You git host is not supported");