Update PluginRepo.plugin.js
This commit is contained in:
parent
01a6fa2b01
commit
1cb53a7027
|
@ -835,13 +835,10 @@ class PluginRepo {
|
||||||
if (!webviewdata) return;
|
if (!webviewdata) return;
|
||||||
webviewrunning = true;
|
webviewrunning = true;
|
||||||
let {body, url} = webviewdata;
|
let {body, url} = webviewdata;
|
||||||
console.log({body, url});
|
|
||||||
let name = body.replace(new RegExp("\\s*\:\\s*", "g"), ":").split('"name":"');
|
let name = body.replace(new RegExp("\\s*\:\\s*", "g"), ":").split('"name":"');
|
||||||
if (name.length > 1) {
|
if (name.length > 1) {
|
||||||
name = name[1].split('"')[0];
|
name = name[1].split('"')[0];
|
||||||
console.log("1: " + name);
|
|
||||||
webview.getWebContents().executeJavaScript(body).then(() => {
|
webview.getWebContents().executeJavaScript(body).then(() => {
|
||||||
console.log("2: " + name);
|
|
||||||
webview.getWebContents().executeJavaScript(`
|
webview.getWebContents().executeJavaScript(`
|
||||||
var p = new ` + name + `();
|
var p = new ` + name + `();
|
||||||
var data = {
|
var data = {
|
||||||
|
@ -852,7 +849,6 @@ class PluginRepo {
|
||||||
};
|
};
|
||||||
Promise.resolve(data);`
|
Promise.resolve(data);`
|
||||||
).then((plugin) => {
|
).then((plugin) => {
|
||||||
console.log("3: " + name);
|
|
||||||
plugin.url = url;
|
plugin.url = url;
|
||||||
this.loadedPlugins[url] = plugin;
|
this.loadedPlugins[url] = plugin;
|
||||||
var installedPlugin = window.bdplugins[plugin.getName] ? window.bdplugins[plugin.getName].plugin : null;
|
var installedPlugin = window.bdplugins[plugin.getName] ? window.bdplugins[plugin.getName].plugin : null;
|
||||||
|
|
Loading…
Reference in New Issue