How to use the electron-devtools-installer.default function in electron-devtools-installer

To help you get started, we’ve selected a few electron-devtools-installer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alessioforte / transee / src / main / main.dev.js View on Github external
app.on('ready', () => {

  installExtension(REACT_DEVELOPER_TOOLS)
    .then(name => console.log(`Added Extension: ${name}`))
    .catch(err => console.log('An error occurred: ', err))
  installExtension(REDUX_DEVTOOLS)
    .then(name => console.log(`Added Extension: ${name}`))
    .catch(err => console.log('An error occurred: ', err))

  let check = app.getLoginItemSettings().openAtLogin
  console.log('start at login:', check)
  settings.set('start-login', check)
  createWindow()
  createPreferencesWindow()
  // createWelcomeWindow()

  let checkAutomaticallyUpdates = settings.has('check-automatically-updates') ? settings.get('check-automatically-updates') : true
  if (checkAutomaticallyUpdates) {
    console.log('automatically check updates')
github prisma-labs / graphql-playground / packages / graphql-playground-electron / src / main.ts View on Github external
)

  if (dev) {
    // If dev mode install react and redux extension
    // Also open the devtools
    const {
      default: installExtension,
      REACT_DEVELOPER_TOOLS,
      REDUX_DEVTOOLS,
    } = require('electron-devtools-installer')

    installExtension(REACT_DEVELOPER_TOOLS)
      .then(name => log.info(`Added Extension:  ${name}`))
      .catch(err => log.info('An error occurred: ', err))

    installExtension(REDUX_DEVTOOLS)
      .then(name => log.info(`Added Extension:  ${name}`))
      .catch(err => log.info('An error occurred: ', err))

    // newWindow.webContents.openDevTools()
  }

  windows.add(newWindow)
  windowById.set(newWindow.id, newWindow)

  // Emitted when the window is closed.
  const id = newWindow.id
  newWindow.on('closed', function() {
    if (process.platform !== 'darwin' && windows.size === 0) {
      app.quit()
    }
    windows.delete(newWindow)
github textileio / desktop / public / electron.ts View on Github external
skipTaskbar: true,
  })

  mainWindow.loadURL(isDev ? 'http://localhost:3000' : url.format({
    pathname: path.join(__dirname, '../build', 'index.html'),
    protocol: 'file:',
    slashes: true
  }))

  if (isDev) {
    const {
      default: installExtension,
      REACT_DEVELOPER_TOOLS
    } = require('electron-devtools-installer')

    installExtension(REACT_DEVELOPER_TOOLS)
      .then(name => {
        console.log(`Added Extension: ${name}`)
      })
      .catch(err => {
        console.log('An error occurred: ', err)
      })
  }

  // Emitted when the window is closed.
  mainWindow.on('closed', function () {
    // 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
    tray = null
  })
github tahnik / devRantron / app / src / app.js View on Github external
mainWindow.loadURL(url.format({
    pathname: path.join(__dirname, 'index.html'),
    protocol: 'file:',
    slashes: true,
  }));

  if (process.env.NODE_ENV === 'development') {
    // Open the DevTools.
    mainWindow.webContents.openDevTools();

    /* eslint-disable no-console */
    installExtension(REACT_DEVELOPER_TOOLS)
      .then(name => console.log(`Added Extension:  ${name}`))
      .catch(err => console.log('An error occurred: ', err));

    installExtension(REDUX_DEVTOOLS)
      .then(name => console.log(`Added Extension:  ${name}`))
      .catch(err => console.log('An error occurred: ', err));
  }

  // just show the window if all content has been loaded
  mainWindow.on('ready-to-show', () => {
    mainWindow.show();
    mainWindow.focus();

    // measure startup time
    console.timeEnd('startup'); //eslint-disable-line
  });

  // Emitted when the window is closed.
  mainWindow.on('closed', () => {
    // Dereference the window object, usually you would store windows
github waleedahmad / Snipper / app / src / main / app.js View on Github external
slashes: true,
    }) + '?main');

    if (dev) {
        // Open the DevTools.
        mainWindow.webContents.openDevTools();
        const {
            default: installExtension,
            REACT_DEVELOPER_TOOLS,
            REDUX_DEVTOOLS,
        } = require('electron-devtools-installer'); // eslint-disable-line
        installExtension(REACT_DEVELOPER_TOOLS)
            .then(name => console.log(`Added Extension:  ${name}`))
            .catch(err => console.log('An error occurred: ', err));

        installExtension(REDUX_DEVTOOLS)
            .then(name => console.log(`Added Extension:  ${name}`))
            .catch(err => console.log('An error occurred: ', err));
    }

    // 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;
    });
}
github billyvg / pokemon-journal / main.development.js View on Github external
const installExtensions = async () => {
  if (process.env.NODE_ENV === 'development') {
    const installer = require('electron-devtools-installer'); // eslint-disable-line global-require
    const extensions = [
      'REACT_DEVELOPER_TOOLS',
      'REDUX_DEVTOOLS'
    ];
    const forceDownload = !!process.env.UPGRADE_EXTENSIONS;
    for (const name of extensions) {
      try {
        await installer.default(installer[name], forceDownload);
      } catch (e) {} // eslint-disable-line
    }
  }
};
github textlint / textlint-app / src / node / index.js View on Github external
return new Promise((resolve, reject) => {
        if (process.env.NODE_ENV === "development") {
            const installer = require("electron-devtools-installer"); // eslint-disable-line global-require

            const extension = "REACT_DEVELOPER_TOOLS";
            const forceDownload = !!process.env.UPGRADE_EXTENSIONS;
            return installer.default(installer[extension], forceDownload).then(resolve, reject);
        }
        resolve();
    });
github epilande / yarems / main.js View on Github external
      extensions.map(name => installer.default(installer[name], forceDownload)),
    ).catch(console.log);
github gilmarsquinelato / i18n-manager / main / devtoolsInstaller.ts View on Github external
const installExtensions = async () => {
  const {
    default: installExtension,
    REDUX_DEVTOOLS,
    REACT_DEVELOPER_TOOLS,
  } = require('electron-devtools-installer');

  try {
    const result = await Promise.all([
      installExtension(REDUX_DEVTOOLS),
      installExtension(REACT_DEVELOPER_TOOLS),
    ]);

    console.log('Electron DevTools Installer result:', result);
  } catch (e) {
    console.log('Electron DevTools Installer error:', e);
  }
};
github gilmarsquinelato / i18n-manager / main / devtoolsInstaller.ts View on Github external
const installExtensions = async () => {
  const {
    default: installExtension,
    REDUX_DEVTOOLS,
    REACT_DEVELOPER_TOOLS,
  } = require('electron-devtools-installer');

  try {
    const result = await Promise.all([
      installExtension(REDUX_DEVTOOLS),
      installExtension(REACT_DEVELOPER_TOOLS),
    ]);

    console.log('Electron DevTools Installer result:', result);
  } catch (e) {
    console.log('Electron DevTools Installer error:', e);
  }
};