Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
mainWindow = new BrowserWindow(defaultWindow) // put demoWindow here
mainWindow.loadURL(config.url)
if (is.windows()) {
mainWindow.setMenu(null)
}
if (is.dev()) {
mainWindow.setSize(1200, 600)
mainWindow.setResizable(true)
mainWindow.setMovable(true)
BrowserWindow.addDevToolsExtension(path.join(__dirname, '../node_modules/devtron'))
let installExtension = require('electron-devtools-installer')
installExtension.default(installExtension.VUEJS_DEVTOOLS)
.then((name) => mainWindow.webContents.openDevTools())
.catch((err) => console.log('An error occurred: ', err))
}
if (is.osx() && is.production()) {
// allow dev tools in prod
mainWindow.webContents.on('devtools-opened', (event, deviceList, callback) => {
mainWindow.setSize(1200, 600)
mainWindow.setResizable(true)
})
mainWindow.webContents.on('devtools-closed', (event, deviceList, callback) => {
mainWindow.setSize(WINDOW.width, WINDOW.height)
// mainWindow.setResizable(false)
})
width: 1000,
webPreferences: {
webSecurity: false,
nodeIntegration: true,
allowDisplayingInsecureContent: true
}
})
mainWindow.loadURL(config.url)
// mainWindow.openDevTools();
if (process.env.NODE_ENV === 'development') {
BrowserWindow.addDevToolsExtension(path.join(__dirname, '../node_modules/devtron'))
let installExtension = require('electron-devtools-installer')
installExtension.default(installExtension.VUEJS_DEVTOOLS)
.then((name) => mainWindow.webContents.openDevTools())
.catch((err) => console.log('An error occurred: ', err))
}
mainWindow.on('closed', () => {
mainWindow = null
})
console.log('mainWindow opened')
}
require('electron').app.on('ready', () => {
let installExtension = require('electron-devtools-installer')
installExtension.default(installExtension.VUEJS_DEVTOOLS)
.then(() => {})
.catch(err => {
console.log('Unable to install `vue-devtools`: \n', err)
})
})
require('electron').app.on('ready', () => {
require('devtron').install()
let installExtension = require('electron-devtools-installer')
installExtension.default(installExtension.VUEJS_DEVTOOLS)
.then(() => {})
.catch(err => {
console.log('Unable to install `vue-devtools`: \n', err)
})
})
width: 700,
height: 75,
minWidth: 700,
minHeight: 75,
frame: false,
transparent: true
})
move(mainWindow)
mainWindow.loadURL(`file://${__dirname}/index.html`)
if (isDev) {
mainWindow.webContents.openDevTools()
const installExtension = require('electron-devtools-installer')
installExtension.default(installExtension.VUEJS_DEVTOOLS)
.then(name => console.log(`Added Extension: ${name}`))
.catch(err => console.log('An error occurred: ', err))
}
mainWindow.on('closed', function () {
mainWindow = null
})
const ret = globalShortcut.register('Alt+Space', () => {
if (mainWindow.isFocused()) mainWindow.hide()
else mainWindow.show()
})
if (!ret) {
console.log('Global shortcut registration failed')
global.appRoot = path.resolve(__dirname);
global.botPath = path.join(global.appRoot, 'gofbot');
if (process.env.NODE_ENV === 'development') {
global.botPath = path.join(global.appRoot, 'dist/gofbot')
}
mainWindow.loadURL(config.url);
if (process.env.NODE_ENV === 'development') {
BrowserWindow.addDevToolsExtension(path.join(__dirname, '../node_modules/devtron'));
let installExtension = require('electron-devtools-installer');
installExtension.default(installExtension.VUEJS_DEVTOOLS)
.then((name) => mainWindow.webContents.openDevTools())
.catch((err) => console.log('An error occurred: ', err))
}
mainWindow.on('closed', () => {
mainWindow = null
});
console.log('mainWindow opened')
}
win.on('focus', () => {
web.send('win-focus')
})
win.on('enter-full-screen', () => {
web.send('enter-full-screen')
})
win.on('leave-full-screen', () => {
web.send('leave-full-screen')
})
if (isDev) {
const installExtension = require('electron-devtools-installer')
installExtension.default(installExtension.VUEJS_DEVTOOLS)
.then(name => console.log(`Added Extension: ${name}`))
.catch(err => console.log('An error occurred: ', err))
}
this.wins++
win.$state = {
unsaved: 0
}
win.$config = config
return win
}
}
require('electron').app.on('ready', () => {
let installExtension = require('electron-devtools-installer')
installExtension.default(installExtension.VUEJS_DEVTOOLS)
.then(() => {})
.catch(err => {
console.log('Unable to install `vue-devtools`: \n', err)
})
})