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