代码拉取完成,页面将自动刷新
const { app, BrowserWindow, globalShortcut } = require('electron')
require('./lib/channel/event.js')
require('./lib/channel/disk.js')
function createWindow () {
const win = require('./lib/windows/index.js')
win.removeMenu()
// 加载index.html文件
win.loadFile('dist/index.html')
//当所有窗口都被关闭后退出
app.on('window-all-closed', () => {
// 在 macOS 上,除非用户用 Cmd + Q 确定地退出,
// 否则绝大部分应用及其菜单栏会保持激活。
if (process.platform !== 'darwin') {
app.quit()
}
})
// shell.openPath('/var/code')
// win.webContents.openDevTools()
}
app.on('activate', () => {
// 在macOS上,当单击dock图标并且没有其他窗口打开时,
// 通常在应用程序中重新创建一个窗口。
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})
app.whenReady().then(() => {
globalShortcut.register('Command+Q', () => {
if (process.platform === 'darwin') { // 手动处理mac的退出程序
app.quit()
}
});
require('./lib/windows/index.js').setTouchBar(require('./lib/windows/touchbar.js'));
// 手动处理macOS复制粘贴无效
// if (process.platform === 'darwin') {
// const win = require('./lib/windows/index.js');
// globalShortcut.register('Command+C', () => {
// if (win.isFocused()) win.webContents.copy();
// });
// globalShortcut.register('Command+V', () => {
// if (win.isFocused()) win.webContents.paste();
// });
// globalShortcut.register('Command+A', () => {
// if (win.isFocused()) win.webContents.selectAll();
// });
// }
}).then(createWindow)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。