other-window.js 423 B

123456789101112131415161718192021
  1. const { app, BrowserWindow } = require('electron');
  2. const ints = (...args) => args.map(a => parseInt(a, 10));
  3. const [x, y, width, height] = ints(...process.argv.slice(2));
  4. let w; // eslint-disable-line @typescript-eslint/no-unused-vars
  5. app.whenReady().then(() => {
  6. w = new BrowserWindow({
  7. x,
  8. y,
  9. width,
  10. height
  11. });
  12. console.log('__ready__');
  13. });
  14. process.on('SIGTERM', () => {
  15. process.exit(0);
  16. });