1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00
Files
Boostnote/lib/main-window.js
2015-12-29 02:18:37 +09:00

40 lines
772 B
JavaScript

const electron = require('electron')
const app = electron.app
const BrowserWindow = electron.BrowserWindow
const path = require('path')
var mainWindow = new BrowserWindow({
width: 1080,
height: 720,
'zoom-factor': 1.0,
'web-preferences': {
'overlay-scrollbars': true
},
'standard-window': false
})
const url = path.resolve(__dirname, './main.html')
mainWindow.loadURL('file://' + url)
mainWindow.webContents.on('new-window', function (e) {
e.preventDefault()
})
mainWindow.webContents.sendInputEvent({
type: 'keyDown',
keyCode: '\u0008'
})
mainWindow.webContents.sendInputEvent({
type: 'keyUp',
keyCode: '\u0008'
})
app.on('activate', function () {
if (mainWindow == null) return null
mainWindow.show()
})
module.exports = mainWindow