5 Star 0 Fork 0

Yur1Ka / myteamengine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.js 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
UNLESS 提交于 2021-07-12 11:55 . update
const { app, BrowserWindow, BrowserView, ipcMain, Menu } = require('electron')
const path = require('path')
function createWindow() {
const editorWindow = new BrowserWindow({
width: 1400,
height: 1000,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
enableRemoteModule: true,
webSecurity: false,
webviewTag: true
// preload: path.join(__dirname, 'preload.js')
}
})
editorWindow.loadURL('http://localhost:8080/editor.html');
const runtimeView = new BrowserView()
editorWindow.setBrowserView(runtimeView)
runtimeView.setBounds({ x: 206, y: 2, width: 600, height: 600 })
runtimeView.webContents.loadURL('http://localhost:8080/index.html?mode=edit');
runtimeView.webContents.openDevTools();
editorWindow.webContents.openDevTools()
}
app.whenReady().then(() => {
createWindow()
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
// window.addEventListener('contextmenu', (event) => {
// event.preventDefault();
// const contextMenu = createContextMenu();
// contextMenu.popup({
// window: remote.getCurrentWindow()
// });
// }, false);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/yur1ka/myteamengine.git
git@gitee.com:yur1ka/myteamengine.git
yur1ka
myteamengine
myteamengine
master

搜索帮助