mirror of
https://github.com/rubickCenter/rubick
synced 2025-12-26 04:19:27 +08:00
✨ 支持ui插件下载&运行
This commit is contained in:
@@ -9,7 +9,7 @@ export default () => {
|
||||
|
||||
const createWindow = async () => {
|
||||
win = new BrowserWindow({
|
||||
height: 600,
|
||||
height: 60,
|
||||
useContentSize: true,
|
||||
resizable: true,
|
||||
width: 800,
|
||||
|
||||
@@ -12,31 +12,22 @@ export default () => {
|
||||
const createWindow = (plugin) => {
|
||||
win = new BrowserWindow({
|
||||
autoHideMenuBar: true,
|
||||
width: 800,
|
||||
height: 800,
|
||||
width: 850,
|
||||
height: 700,
|
||||
alwaysOnTop: true,
|
||||
resizable: false,
|
||||
focusable: true,
|
||||
show: false,
|
||||
webPreferences: {
|
||||
enableRemoteModule: true,
|
||||
webSecurity: false,
|
||||
nodeIntegration: true,
|
||||
contextIsolation: false,
|
||||
devTools: true,
|
||||
webviewTag: true,
|
||||
preload: `${__static}/preload.js`,
|
||||
},
|
||||
});
|
||||
|
||||
if (process.env.WEBPACK_DEV_SERVER_URL) {
|
||||
// Load the url of the dev server if in development mode
|
||||
win.loadURL("http://localhost:8081" as string);
|
||||
} else {
|
||||
// Load the index.html when not in development
|
||||
win.loadURL(`file://${__static}/runner/index.html`);
|
||||
}
|
||||
win.webContents.on("dom-ready", () => {
|
||||
win.webContents.executeJavaScript(`window.setPluginInfo(${JSON.stringify(plugin)})`);
|
||||
});
|
||||
win.loadURL(plugin.indexPath);
|
||||
|
||||
win.once("ready-to-show", () => {
|
||||
win.show();
|
||||
|
||||
@@ -8,7 +8,6 @@ const API: any = {
|
||||
win.setSize(800, height || 60);
|
||||
},
|
||||
openPlugin({plugin}) {
|
||||
console.log(plugin);
|
||||
runnerInstance.init(plugin);
|
||||
},
|
||||
};
|
||||
|
||||
@@ -5,6 +5,7 @@ import commonConst from "../common/utils/commonConst";
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
import API from "./common/api";
|
||||
import "../common/utils/localPlugin";
|
||||
|
||||
class App {
|
||||
private windowCreator: { init: () => void; getWindow: () => BrowserWindow };
|
||||
|
||||
Reference in New Issue
Block a user