Skip to content

Option to keep window hidden on did-finish-load  #20

Description

@tofuness

I think there should be an option to disable the automatic .show() on a browser window.

Use cases:

  • We want the app to start in the tray and then open the main application window when the tray icon is clicked.
// Use case 1
app.on('ready', () => {
  const mainWindow = window.createWindow({
    width: 100,
    height: 100,
    show: false
  });
  mainWindow.showUrl(somePath);
  trayIcon.on('click', () => mainWindow.show());
});
  • Application requires additional steps before it is ready to be shown.
// Use case 2
app.on('ready', () => {
  const mainWindow = window.createWindow({
    width: 100,
    height: 100,
    show: false
  });
  mainWindow.showUrl(somePath, () => {
    calculatePi();
    someAsyncFunction(() => {
        mainWindow.show();
    });
  });
});

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions