|
|
|
|
@ -37,6 +37,8 @@ function createWindow() {
|
|
|
|
|
mainWindow = new BrowserWindow({
|
|
|
|
|
darkTheme: true,
|
|
|
|
|
webPreferences: {
|
|
|
|
|
enableRemoteModule: true,
|
|
|
|
|
contextIsolation: false,
|
|
|
|
|
nodeIntegration: true,
|
|
|
|
|
// https://github.com/electron/electron/issues/5107
|
|
|
|
|
webSecurity: !isDev,
|
|
|
|
|
@ -47,14 +49,6 @@ function createWindow() {
|
|
|
|
|
// Need to useloadFile for special characters https://github.com/mifi/lossless-cut/issues/40
|
|
|
|
|
else mainWindow.loadFile('build/index.html');
|
|
|
|
|
|
|
|
|
|
if (isDev) {
|
|
|
|
|
const { default: installExtension, REACT_DEVELOPER_TOOLS } = require('electron-devtools-installer'); // eslint-disable-line global-require,import/no-extraneous-dependencies
|
|
|
|
|
|
|
|
|
|
installExtension(REACT_DEVELOPER_TOOLS)
|
|
|
|
|
.then(name => console.log(`Added Extension: ${name}`))
|
|
|
|
|
.catch(err => console.log('An error occurred: ', err));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Open the DevTools.
|
|
|
|
|
// mainWindow.webContents.openDevTools()
|
|
|
|
|
|
|
|
|
|
@ -92,6 +86,15 @@ function updateMenu() {
|
|
|
|
|
app.on('ready', async () => {
|
|
|
|
|
await configStore.init();
|
|
|
|
|
|
|
|
|
|
if (isDev) {
|
|
|
|
|
const { default: installExtension, REACT_DEVELOPER_TOOLS } = require('electron-devtools-installer'); // eslint-disable-line global-require,import/no-extraneous-dependencies
|
|
|
|
|
|
|
|
|
|
installExtension(REACT_DEVELOPER_TOOLS)
|
|
|
|
|
.then(name => console.log(`Added Extension: ${name}`))
|
|
|
|
|
.catch(err => console.log('An error occurred: ', err));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
createWindow();
|
|
|
|
|
updateMenu();
|
|
|
|
|
|
|
|
|
|
|