Files
dinlo 436a9631fc Initial commit
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 18:44:04 +08:00

26 lines
720 B
JavaScript

const { app, BrowserWindow, ipcMain } = require('electron');
const path = require('path');
function createWindow() {
const win = new BrowserWindow({
width: 550,
height: 800,
frame: false,
transparent: true,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
webSecurity: false // Важно для работы с Obsidian API
}
});
win.loadFile('index.html');
// win.webContents.openDevTools(); // Раскомментируйте для отладки
}
app.whenReady().then(createWindow);
ipcMain.on('close-app', () => app.quit());
ipcMain.on('minimize-app', () => {
const win = BrowserWindow.getFocusedWindow();
if (win) win.minimize();
});