Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
width: 1024
};
// configure the splashscreen
mainWindow = Splashscreen.initSplashScreen({
splashScreenOpts: {
height: 400,
transparent: true,
width: 400
},
templateUrl: path.join(__dirname, 'resources', 'images', 'icon.png'),
windowOpts: windowOptions
});
// Open the DevTools.
if (isDev) {
await installExtension(REDUX_DEVTOOLS);
await installExtension(REACT_DEVELOPER_TOOLS);
mainWindow.webContents.openDevTools();
}
// and load the index.html of the appState.
mainWindow.loadURL(`file://${__dirname}/index.html`);
mainWindow.on('closed', () => {
mainWindow = null;
logger.info('closed');
app.quit();
});
mainWindow.on('unresponsive', () => {
mainWindow = null;
logger.info('unresponsive');
mainWindow = new BrowserWindow({
icon: path.join(__dirname, '../resources/styles/image/logo/logo.iconset/icon_512x512.png'),
width: 860,
height: 750,
minWidth: 860,
minHeight: 680,
backgroundColor: '#fff',
});
}
// and load the index.html of the app.
mainWindow.loadURL(`file://${__dirname}/index.html`);
// Open the DevTools.
if (isDevMode) {
await installExtension(REACT_DEVELOPER_TOOLS);
mainWindow.webContents.openDevTools();
}
if (!isDevMode && process.platform === 'darwin') {
// Create the Application's main menu
const template = [{
label: 'Application',
submenu: [
{ label: 'About Application', selector: 'orderFrontStandardAboutPanel:' },
{ type: 'separator' },
{ label: 'Quit', accelerator: 'Command+Q', click() { app.quit(); } },
] }, {
label: 'Edit',
submenu: [
{ label: 'Undo', accelerator: 'CmdOrCtrl+Z', selector: 'undo:' },
{ label: 'Redo', accelerator: 'Shift+CmdOrCtrl+Z', selector: 'redo:' },
{ type: 'separator' },
const createWindow = async () => {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
});
// and load the index.html of the app.
mainWindow.loadURL(`file://${__dirname}/index.html`);
// Open the DevTools.
if (isDevMode) {
await installExtension(REACT_DEVELOPER_TOOLS);
// mainWindow.webContents.openDevTools();
}
// Emitted when the window is closed.
mainWindow.on('closed', () => {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null;
});
};
return new Promise(async (resolve, reject) => {
// Create the browser window.
let window = new BrowserWindow({
width: 800,
height: 600,
webPreferences: { scrollBounce: true }
});
windows.push(window);
// and load the index.html of the app.
window.loadURL(`file://${__dirname}/index.html`);
// Open the DevTools.
if (isDevMode) {
await installExtension(REACT_DEVELOPER_TOOLS);
window.webContents.openDevTools();
}
// Emitted when the window is closed.
window.on('closed', () => {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
windows = _.without(windows, window);
});
buildAndSetMenu(options, window);
resolve(window);
});
};
import installExtension, {
EMBER_INSPECTOR, REACT_DEVELOPER_TOOLS,
BACKBONE_DEBUGGER, JQUERY_DEBUGGER,
ANGULARJS_BATARANG, VUEJS_DEVTOOLS,
REDUX_DEVTOOLS, REACT_PERF,
} from 'electron-devtools-installer';
installExtension(EMBER_INSPECTOR);
installExtension(REACT_DEVELOPER_TOOLS);
installExtension(BACKBONE_DEBUGGER);
installExtension(JQUERY_DEBUGGER);
installExtension(ANGULARJS_BATARANG);
installExtension(VUEJS_DEVTOOLS);
installExtension(REDUX_DEVTOOLS);
installExtension(REACT_PERF);
installExtension('abcdefghijkl');
private devtools = () => {
installExtension(REACT_DEVELOPER_TOOLS)
.then((name) => console.log(`Added Extension: ${name}`))
.catch((err) => console.log('An error occurred: ', err));
}
}
protected async create(): Promise
{
this.loadURL(Window.getUrl());
if (isDev) {
await installExtension(REACT_DEVELOPER_TOOLS);
}
}
function installExtensions() {
const forceDownload = !!process.env.UPGRADE_EXTENSIONS;
return Promise.all([
devToolsInstall(REACT_DEVELOPER_TOOLS, forceDownload),
devToolsInstall(REDUX_DEVTOOLS, forceDownload),
]);
}
import installExtension, { REACT_DEVELOPER_TOOLS } from 'electron-devtools-installer'
import { log, error } from './utils'
installExtension(REACT_DEVELOPER_TOOLS)
.then(name => log('React Devtool is added'))
.catch(err => error('An error occurred: ', err))
function installExtensions() {
const forceDownload = !!process.env.UPGRADE_EXTENSIONS;
return Promise.all([
devToolsInstall(REACT_DEVELOPER_TOOLS, forceDownload),
devToolsInstall(REDUX_DEVTOOLS, forceDownload),
]);
}