From 20c6c37c1b927d765e592f3942e3f681a24530bc Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 13:03:58 -0400 Subject: [PATCH] docs: clarify before `ready` usage (#41860) Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Erick Zhao --- docs/api/app.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/api/app.md b/docs/api/app.md index 178135e63b83..a7a46f4e73c5 100755 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -41,6 +41,10 @@ that was used to open the application, if it was launched from Notification Cent You can also call `app.isReady()` to check if this event has already fired and `app.whenReady()` to get a Promise that is fulfilled when Electron is initialized. +**Note**: The `ready` event is only fired after the main process has finished running the first +tick of the event loop. If an Electron API needs to be called before the `ready` event, ensure +that it is called synchronously in the top-level context of the main process. + ### Event: 'window-all-closed' Emitted when all windows have been closed.