diff --git a/astilectron.go b/astilectron.go index c49c4d7..cfefad5 100644 --- a/astilectron.go +++ b/astilectron.go @@ -13,7 +13,7 @@ import ( // Versions const ( DefaultAcceptTCPTimeout = 30 * time.Second - DefaultVersionAstilectron = "0.41.0" + DefaultVersionAstilectron = "0.42.0" DefaultVersionElectron = "7.1.10" ) @@ -28,14 +28,15 @@ var ( // App event names const ( - EventNameAppClose = "app.close" - EventNameAppCmdQuit = "app.cmd.quit" // Sends an event to Electron to properly quit the app - EventNameAppCmdStop = "app.cmd.stop" // Cancel the context which results in exiting abruptly Electron's app - EventNameAppCrash = "app.crash" - EventNameAppErrorAccept = "app.error.accept" - EventNameAppEventReady = "app.event.ready" - EventNameAppNoAccept = "app.no.accept" - EventNameAppTooManyAccept = "app.too.many.accept" + EventNameAppClose = "app.close" + EventNameAppCmdQuit = "app.cmd.quit" // Sends an event to Electron to properly quit the app + EventNameAppCmdStop = "app.cmd.stop" // Cancel the context which results in exiting abruptly Electron's app + EventNameAppCrash = "app.crash" + EventNameAppErrorAccept = "app.error.accept" + EventNameAppEventReady = "app.event.ready" + EventNameAppEventSecondInstance = "app.event.second.instance" + EventNameAppNoAccept = "app.no.accept" + EventNameAppTooManyAccept = "app.too.many.accept" ) // Astilectron represents an object capable of interacting with Astilectron diff --git a/event.go b/event.go index 9984a65..a9c9984 100644 --- a/event.go +++ b/event.go @@ -41,6 +41,7 @@ type Event struct { Password string `json:"password,omitempty"` Reply string `json:"reply,omitempty"` Request *EventRequest `json:"request,omitempty"` + SecondInstance *EventSecondInstance `json:"secondInstance,omitempty"` SessionID string `json:"sessionId,omitempty"` Supported *Supported `json:"supported,omitempty"` TrayOptions *TrayOptions `json:"trayOptions,omitempty"` @@ -116,6 +117,12 @@ type EventRequest struct { URL string `json:"url,omitempty"` } +// EventSecondInstance represents data related to a second instance of the app being started +type EventSecondInstance struct { + CommandLine []string `json:"commandLine,omitempty"` + WorkingDirectory string `json:"workingDirectory,omitempty"` +} + // EventSubMenu represents a sub menu event type EventSubMenu struct { ID string `json:"id"`