mirror of
https://github.com/rubickCenter/rubick
synced 2025-12-18 00:34:19 +08:00
✨ 支持ui插件下载&运行
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user