Fixed bug in PluginRepo

This commit is contained in:
Mirco Wittrien 2018-12-12 12:21:24 +01:00
parent 70fbb89771
commit 01a6fa2b01
2 changed files with 7 additions and 4 deletions

View File

@ -239,7 +239,7 @@ class PluginRepo {
getDescription () {return "Allows you to look at all plugins from the plugin repo and download them on the fly. Repo button is in the plugins settings.";}
getVersion () {return "1.6.1";}
getVersion () {return "1.6.2";}
getAuthor () {return "DevilBro";}
@ -746,7 +746,7 @@ class PluginRepo {
if (!response) {
if (url && BDFDB.getAllIndexes(this.foundPlugins, url).length < 2) this.foundPlugins.push(url);
}
else {
else if (body.indexOf("404: Not Found") != 0) {
let plugin = {};
let bodycopy = body;
if (body.length / body.split("\n").length > 1000) {
@ -835,11 +835,14 @@ class PluginRepo {
if (!webviewdata) return;
webviewrunning = true;
let {body, url} = webviewdata;
console.log({body, url});
let name = body.replace(new RegExp("\\s*\:\\s*", "g"), ":").split('"name":"');
if (name.length > 1) {
name = name[1].split('"')[0];
console.log("1: " + name);
webview.getWebContents().executeJavaScript(body).then(() => {
webview.getWebContents().executeJavaScript(`
console.log("2: " + name);
webview.getWebContents().executeJavaScript(`
var p = new ` + name + `();
var data = {
"getName":p.getName(),
@ -849,6 +852,7 @@ class PluginRepo {
};
Promise.resolve(data);`
).then((plugin) => {
console.log("3: " + name);
plugin.url = url;
this.loadedPlugins[url] = plugin;
var installedPlugin = window.bdplugins[plugin.getName] ? window.bdplugins[plugin.getName].plugin : null;

View File

@ -9,7 +9,6 @@ https://raw.githubusercontent.com/Anxeal/BDEnhancements/master/plugins/ResizeX/R
https://raw.githubusercontent.com/Arashiryuu/crap/master/doesNotEqualsInsertion.plugin.js
https://raw.githubusercontent.com/Arashiryuu/crap/master/greenText.plugin.js
https://raw.githubusercontent.com/Arashiryuu/crap/master/Miscellanious/backtickInsertion.plugin.js
https://raw.githubusercontent.com/Arashiryuu/crap/master/Miscellanious/catImg.plugin.js
https://raw.githubusercontent.com/Arashiryuu/crap/master/Miscellanious/jsMaterialThemeCodeblocks.plugin.js
https://raw.githubusercontent.com/Arashiryuu/crap/master/Miscellanious/statusProfileContainer.plugin.js
https://raw.githubusercontent.com/Arashiryuu/crap/master/ToastIntegrated/ChatUserIDsRedux/ChatUserIDsRedux.plugin.js