Windows

4.7.1

The Window Management API lets you create and manipulate windows and is the basis of the Application Management and Activities APIs. Glue42 Windows allow users to group a set of desktop windows so that they move, maximize and minimize together. The Window Management API provides the following features, not found in any normal browser:

  • 3 types of window modes: flat, tab or HTML
  • Complete control and customization of the windows:
  • visibility - create hidden windows, show them later;
  • bounds - set window location and/or size;
  • user interaction - allow a window to be sticky, enable/disable minimize/maximize/close buttons;
  • add custom buttons to the windows and respond accordingly to user interaction with them;
  • organize windows into tabs that the user can also tear off;

See also Window Management

object

Description

Window Management API.

methodmy
() => GDWindow

Description

Returns the current window.

Returns

GDWindow

methodopen
(name: string, url: string, options: WindowCreateOptions, success: (window: GDWindow) => void, error: (error: object) => void) => Promise<GDWindow>

Description

Opens a new Glue42 Window.

Parameters

Name
Type
Required
Description

name

string

yes

A unique window name.

url

string

yes

The window URL.

options

no

Options for creating a window.

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: object) => void

no

Optional error callback to handle errors.

Returns

Promise<GDWindow>

methodfind
(name: string, success: (window: GDWindow) => void, error: (error: string) => void) => GDWindow

Description

Finds a window by name.

Parameters

Name
Type
Required
Description

name

string

yes

A unique window name.

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional error callback to handle errors.

Returns

GDWindow

methodfindById
(id: string, success: (window: GDWindow) => void, error: (error: string) => void) => GDWindow

Description

Finds a window by ID.

Parameters

Name
Type
Required
Description

id

string

yes

Window ID.

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional error callback to handle errors.

Returns

GDWindow

methodlist
(success: (windows: GDWindow[]) => void) => GDWindow[]

Description

Lists all windows.

Parameters

Name
Type
Required
Description

success

(windows: GDWindow[]) => void

no

Optional success callback to handle the returned windows.

Returns

GDWindow[]

(targetWindowId: string, config: FlydownOptions) => Promise<Flydown>

Description

Creates a flydown window.

Parameters

Name
Type
Required
Description

targetWindowId

string

yes

ID of the window for which to create the flydown.

config

yes

Options for creating a flydown window.

Returns

Promise<Flydown>

methodshowPopup
(targetWindowId: string, config: PopupOptions) => Promise<void>

Description

Creates a popup window.

Parameters

Name
Type
Required
Description

targetWindowId

string

yes

ID of the window for which to create the popup.

config

yes

Options for creating a popup window.

Returns

Promise<void>

(callback: (window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when a new window is opened. For backwards compatibility, you can also use windowAdded.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Callback function to handle the event. Receives the added window as a parameter. Returns an unsubscribe function.

Returns

UnsubscribeFunction

(callback: (window: GDWindow) => void) => UnsubscribeFunction

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Returns

UnsubscribeFunction

(callback: (window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when a window is closed. For backwards compatibility, you can also use windowRemoved.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Callback function to handle the event. Receives the removed window as a parameter. Returns an unsubscribe function.

Returns

UnsubscribeFunction

(callback: (window: GDWindow) => void) => UnsubscribeFunction

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Returns

UnsubscribeFunction

(callback: (tabWindow: GDWindow, newTabGroupId: string, tabHeaderVisible: boolean) => void) => Promise<void>

Description

Notifies when a tab window is attached to another tab group. This is a generic event handler that provides information for both the window being attached and the group of tab windows that the tab is attached to.

Parameters

Name
Type
Required
Description

callback

(tabWindow: GDWindow, newTabGroupId: string, tabHeaderVisible: boolean) => void

yes

Callback function to handle the event. Receives as parameters the attached tab window, the ID of the new tab group and a boolean value showing whether the header of the tab is visible or not.

Returns

Promise<void>

(callback: (window: GDWindow, tabGroupId: string, oldTabGroupId: string) => void) => Promise<void>

Description

Notifies you when a tab window is detached from another tab group. This is a generic event handler that provides information for both the window being detached and the group of tab windows that the tab is being detached from.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow, tabGroupId: string, oldTabGroupId: string) => void

yes

Callback function to handle the event. Receives as parameters the detached tab window, the ID of the new tab group and a the ID of the old tab group.

Returns

Promise<void>

(callback: (window: GDWindow) => void) => Promise

Description

Notifies when the window frame color is changed.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Callback function to handle the event. Receives the window instance as a parameter. Returns a Promise which resolves with an unsubscribe function.

Returns

Promise

(callback: (window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when a window receives focus.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Callback function to handle the event. Receives the window instance as a parameter. Returns an unsubscribe function.

Returns

UnsubscribeFunction

(callback: (window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when a window loses focus.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Callback function to handle the event. Receives the window instance as a parameter. Returns an unsubscribe function.

Returns

UnsubscribeFunction

methodready
() => Promise<any>

Description

Returns a Promise that resolves when the library is ready.

Returns

Promise<any>

Properties

Returns the API for managing group windows.

object

Description

Glue42 Window object.

methodattachTab
(tab: string | GDWindow, index: number, success: () => void, error: (error: string) => void) => Promise<GDWindow>

Description

Attaches a tab window to the current tab window.

Parameters

Name
Type
Required
Description

tab

string | GDWindow

yes

The instance or the name of the tab window to attach.

index

number

yes

Index for the attached tab. Determines the position of the tab in the tab group.

success

() => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

methoddetachTab
(opt: DetachOptions, success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Detaches a tab window from the current tab window.

Parameters

Name
Type
Required
Description

opt

yes

Settings for the detached window.

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

methodmaximize
(success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Maximizes a window.

Parameters

Name
Type
Required
Description

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

methodrestore
(success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Restores a window.

Parameters

Name
Type
Required
Description

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

methodminimize
(success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Minimizes a window.

Parameters

Name
Type
Required
Description

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

(success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Maximizes or restores the current window based on the current window state.

Parameters

Name
Type
Required
Description

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

methodcollapse
(success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Collapses a window.

Parameters

Name
Type
Required
Description

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

methodexpand
(success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Expands a window.

Parameters

Name
Type
Required
Description

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

(success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Collapses or expands the current window based on the current window state.

Parameters

Name
Type
Required
Description

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

methodfocus
(success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Focuses the current window.

Parameters

Name
Type
Required
Description

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

methodactivate
(success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Activates the current window.

Parameters

Name
Type
Required
Description

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

methodmoveResize
(dimension: Bounds, success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Move and/or resize the window.

Parameters

Name
Type
Required
Description

dimension

yes

Location and size for the window.

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

methodsetTitle
(title: string, success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Sets the title of the current window.

Parameters

Name
Type
Required
Description

title

string

yes

The title for the window.

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

methodsetStyle
(styles: WindowStyle, success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Sets the style of the current window.

Parameters

Name
Type
Required
Description

styles

yes

An object defining the window frame buttons, window size constraints, focus and visibility.

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

(buttons: WindowButtons, success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Resets the visible buttons of the window frame.

Parameters

Name
Type
Required
Description

buttons

yes

An object defining which buttons to be shown on the window frame.

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

methodsetOnTop
(onTop: boolean, success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Z-index setting. If true, will make the window appear on top of all other windows.

Parameters

Name
Type
Required
Description

onTop

boolean

yes

success

(window: GDWindow) => void

no

error

(error: string) => void

no

Returns

Promise<GDWindow>

(constraints: SizeConstraints, success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Changes the size constraints of the window.

Parameters

Name
Type
Required
Description

constraints

yes

Min and max width and height constraints for the window.

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

methodnavigate
(url: string, success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Navigates the window to a new URL.

Parameters

Name
Type
Required
Description

url

string

yes

URL to navigate to.

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

(buttonInfo: ButtonInfo, success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Adds a frame button to the window.

Parameters

Name
Type
Required
Description

buttonInfo

yes

Window button settings.

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

(buttonId: string, success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Removes a frame button from the window.

Parameters

Name
Type
Required
Description

buttonId

string

yes

ID of the button to remove.

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

methodsetVisible
(toBeVisible: boolean, success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Hides or shows the current window.

Parameters

Name
Type
Required
Description

toBeVisible

boolean

no

Whether the window is to be visible or not.

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

methodshow
(success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Shows the current window.

Parameters

Name
Type
Required
Description

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

methodhide
(success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Hides the current window.

Parameters

Name
Type
Required
Description

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

methodclose
(success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Closes the window.

Parameters

Name
Type
Required
Description

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

methodsnap
(target: string | GDWindow, direction: RelativeDirection, success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Snaps the window to another window.

Parameters

Name
Type
Required
Description

target

string | GDWindow

yes

Instance or name of the window to which to snap the current window.

direction

no

Direction for snapping the window. Relative to the target window.

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

methodshowLoader
(options: Loader) => Promise<GDWindow>

Description

Shows a loader animation for the window or updates the loader properties (animation type, background or text).

Parameters

Name
Type
Required
Description

options

no

Settings for the loader animation.

Returns

Promise<GDWindow>

methodhideLoader
() => Promise<GDWindow>

Description

Hides the loader animation for the window.

Returns

Promise<GDWindow>

(context: any, success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Updates the window context.

Parameters

Name
Type
Required
Description

context

any

yes

Context object with which to update the current context (or create a new one if it does not exist).

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

methodlock
(success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Locks the window. When in locked state, moving the window will result in moving the entire group (if it is part of any).

Parameters

Name
Type
Required
Description

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

methodunlock
(success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Unlocks the window. When in unlocked state, moving the window will result in tearing it out from the window group (if it is part of any).

Parameters

Name
Type
Required
Description

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

methodgetIcon
(success: (icon: string) => void, error: InvokeErrorHandler) => Promise<string>

Description

Returns the window icon.

Parameters

Name
Type
Required
Description

success

(icon: string) => void

no

Optional success callback to handle the returned icon.

error

no

Optional callback to handle errors.

Returns

Promise<string>

methodsetIcon
(base64Image: string, success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Sets the window icon.

Parameters

Name
Type
Required
Description

base64Image

string

yes

Icon as a base64 encoded string.

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

(frameColor: string, success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Sets the window frame color.

Parameters

Name
Type
Required
Description

frameColor

string

yes

Can be a color name, such as “red”, or a hex-encoded RGB or ARGB value.

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

(toBeVisible: boolean, success: (window: GDWindow) => void, error: (error: string) => void) => Promise<GDWindow>

Description

Hides or shows the tab header of the current window.

Parameters

Name
Type
Required
Description

toBeVisible

boolean

no

Whether to show or hide the tab header.

success

(window: GDWindow) => void

no

Optional success callback to handle the returned window.

error

(error: string) => void

no

Optional callback to handle errors.

Returns

Promise<GDWindow>

methodshowPopup
(config: PopupOptions) => Promise<GDWindow>

Description

Shows a popup window.

Parameters

Name
Type
Required
Description

config

yes

Options for the popup window.

Returns

Promise<GDWindow>

(config: FlydownOptions) => Promise<Flydown>

Description

Creates a flydown window.

Parameters

Name
Type
Required
Description

config

yes

Options for the flydown window.

Returns

Promise<Flydown>

methodzoomIn
() => Promise<GDWindow>

Description

Zooms in the window.

Returns

Promise<GDWindow>

methodzoomOut
() => Promise<GDWindow>

Description

Zooms out the window.

Returns

Promise<GDWindow>

(factor: number) => Promise<GDWindow>

Description

Changes the zoom level.

Parameters

Name
Type
Required
Description

factor

number

yes

Zoom factor.

Returns

Promise<GDWindow>

methodcapture
(options: CaptureOptions) => Promise<string>

Description

Returns a screenshot of the window.

Parameters

Name
Type
Required
Description

options

yes

Options for capturing the window.

Returns

Promise<string>

methodflash
(options: boolean) => Promise<GDWindow>

Description

Makes the taskbar window icon flash (e.g., to prompt the user to take action).

Parameters

Name
Type
Required
Description

options

boolean

no

Whether to start or stop flashing the taskbar window icon.

Returns

Promise<GDWindow>

methodcenter
(screen: Screen) => Promise<GDWindow>

Description

Moves the window to the center of the screen.

Parameters

Name
Type
Required
Description

screen

no

Optional parameter specifying the screen on which to center the window.

Returns

Promise<GDWindow>

(callback: (window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when a window is attached to the current window.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

(callback: (window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when a window is detached from the current window.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

(callback: (window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when the visibility of the window tab header changes.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

methodonClose
(callback: (window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when the window is closed.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

(callback: (url: string, window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when the window URL is changed.

Parameters

Name
Type
Required
Description

callback

(url: string, window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

(callback: (title: string, window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when the title of the window is changed.

Parameters

Name
Type
Required
Description

callback

(title: string, window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

(callback: (buttonInfo: ButtonInfo, window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when a frame button is added.

Parameters

Name
Type
Required
Description

callback

(buttonInfo: ButtonInfo, window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

(callback: (buttonInfo: ButtonInfo, window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when a frame button is removed.

Parameters

Name
Type
Required
Description

callback

(buttonInfo: ButtonInfo, window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

(callback: (buttonInfo: ButtonInfo, window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when a frame button is clicked.

Parameters

Name
Type
Required
Description

callback

(buttonInfo: ButtonInfo, window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

(callback: (window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when the window is collapsed.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

methodonExpanded
(callback: (window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when the window is expanded.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

(callback: (window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when the window is minimized.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

(callback: (window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when the window is maximized.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

methodonNormal
(callback: (window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when the window is restored from minimized/maximized state to normal state.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

methodonAttached
(callback: (window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when the current window is attached.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

methodonDetached
(callback: (window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when the current window is detached.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

(callback: (window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when the window visibility changes.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

(callback: (context: any, window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when the window context is updated.

Parameters

Name
Type
Required
Description

callback

(context: any, window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

(callback: (window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when the window is locked or unlocked.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

(callback: (window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when the window location is changed.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

(callback: (window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when the window frame color is changed.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

(callback: (window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when the window focus is changed.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

(callback: (window: GDWindow, newGroup: Group, oldGroup: Group) => void) => UnsubscribeFunction

Description

Notifies when the window group is changed.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow, newGroup: Group, oldGroup: Group) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

(callback: (selectedWindow: GDWindow, previousWindow: GDWindow, window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when the active tab is changed.

Parameters

Name
Type
Required
Description

callback

(selectedWindow: GDWindow, previousWindow: GDWindow, window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

methodonClosing
(callback: () => Promise<void>) => void

Description

Notifies when the window is about to close.

Parameters

Name
Type
Required
Description

callback

() => Promise<void>

yes

Callback function to handle the event. Returns a Promise that will be awaited before the window is closed. Subject to a timeout configured in Glue42 Desktop.

Returns

void

(callback: () => Promise<void>) => void

Description

Notifies when the window is about to refresh.

Parameters

Name
Type
Required
Description

callback

() => Promise<void>

yes

Callback function to handle the event. Returns a Promise that will be awaited before the window is refreshed. Subject to a timeout configured in Glue42 Desktop.

Returns

void

(callback: (window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when the zoom factor is changed.

Parameters

Name
Type
Required
Description

callback

(window: GDWindow) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

Properties

"electron" | "remote"

The type of the window.

string

The name of the current window. Window names are unique within Glue42.

string | Instance

The Interop instance that the window runs in.

The Interop instance of the window. Used for easier access to the Interop API.

string

The URL of the current window.

string

The ID of the current window.

The application associated with the current window. Can be undefined if the window was not started as an application.

string

The title of the current window.

Deprecated. Use settings instead. The window styles of the current window.

The settings of the current window.

string

The tab group ID of the current window. When several windows reside in a common tab container they have the same tab group ID.

Returns all frame buttons.

Returns the mode of the window - html, flat, tab.

Returns the state of the window - normal, maximized or minimized.

boolean

Returns true if the window is collapsed.

boolean

Returns true if the window is visible.

boolean

Returns true if the window is locked.

boolean

Whether the window is focused or not.

boolean

Whether the header of the window group is visible or hidden.

any

Returns the context of the window.

Returns the bounds of the window.

number

Returns the minimum height of the window.

number

Returns the maximum height of the window.

number

Returns the minimum width of the window.

number

Returns the maximum width of the window.

string

Returns the color of the window frame.

boolean

Whether the window is open or not.

Returns the group of the window.

string

Returns the ID of the group of the window.

Returns the top neighbours of the window.

Returns the left neighbours of the window.

Returns right neighbours of the window.

Returns bottom neighbours of the window.

string

Returns the ID of the activity the window participates in (undefined if it is not part of an activity).

string

Returns the ID of the window if the window is an activity window (undefined if it is not part of an activity).

Available only when the window is in tab mode. Returns all tabs that are in the same tab group as the current window.

boolean

Whether the tab header of the window is visible or not.

boolean

Whether the tab window is selected.

number

Returns the current zoom factor.

Returns the screen the window is on.

object

Description

Provides access to window groups.

methodlist
(success: (groups: Group[]) => void) => Group[]

Description

Lists all window groups.

Parameters

Name
Type
Required
Description

success

(groups: Group[]) => void

no

Optional callback to handle the returned window groups. Receives an array of the returned window groups as a parameter.

Returns

Group[]

(winId: string | GDWindow, success: (group: Group) => void) => Group

Description

Finds a group by a provided window object or window ID.

Parameters

Name
Type
Required
Description

winId

string | GDWindow

yes

A Glue42 Window object or a window ID by which to find a window group.

success

(group: Group) => void

no

Optional callback to handle the returned window group. Receives the returned window group as a parameter.

Returns

Group

Properties

Returns the current group of the window.

object

Description

Glue42 Windows can be grouped together via the Window Management API. The Group object describes a window group.

methodfind
(window: string | GDWindow, success: (window: GDWindow) => void) => GDWindow

Description

Finds a window by ID or by a window object.

Parameters

Name
Type
Required
Description

window

string | GDWindow

yes

Window ID or a window object by which to find a window in the group.

success

(window: GDWindow) => void

no

Optional callback to handle the returned window.

Returns

GDWindow

methodrestore
(success: (group: Group) => void, error: (error: string) => void) => void

Description

Restores the window group.

Parameters

Name
Type
Required
Description

success

(group: Group) => void

no

Optional success callback to handle the returned window group.

error

(error: string) => void

no

Optional error callback to handle errors.

Returns

void

methodmaximize
(success: (group: Group) => void, error: (error: string) => void) => void

Description

Maximizes the window group.

Parameters

Name
Type
Required
Description

success

(group: Group) => void

no

Optional success callback to handle the maximized window group.

error

(error: string) => void

no

Optional error callback to handle errors.

Returns

void

methodshowHeader
(success: (group: Group) => void, error: InvokeErrorHandler) => Promise<Group>

Description

Shows the window group header.

Parameters

Name
Type
Required
Description

success

(group: Group) => void

no

Optional success callback that receives the window group as a parameter.

error

no

Optional error callback to handle errors.

Returns

Promise<Group>

methodhideHeader
(success: (group: Group) => void, error: () => void) => Promise<Group>

Description

Hides the window group header.

Parameters

Name
Type
Required
Description

success

(group: Group) => void

no

Optional success callback that receives the window group as a parameter.

error

() => void

no

Optional error callback to handle errors.

Returns

Promise<Group>

methodcapture
(options: CaptureOptions) => Promise<string>

Description

Returns an image of the entire window group as a base64 encoded string.

Parameters

Name
Type
Required
Description

options

no

Options for capturing the window group.

Returns

Promise<string>

(callback: (group: Group) => void) => UnsubscribeFunction

Description

Notifies when the visibility of the window group header is changed.

Parameters

Name
Type
Required
Description

callback

(group: Group) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

(callback: (group: Group, window: GDWindow) => void) => UnsubscribeFunction

Description

Notifies when a new window is added to the group.

Parameters

Name
Type
Required
Description

callback

(group: Group, window: GDWindow) => void

yes

Callback function to handle the event. Receives the window group and the added window as parameters. Returns an unsubscribe function.

Returns

UnsubscribeFunction

(callback: (group: Group) => void) => UnsubscribeFunction

Description

Notifies when a window is removed from the group.

Parameters

Name
Type
Required
Description

callback

(group: Group) => void

yes

Callback function to handle the event. Returns an unsubscribe function.

Returns

UnsubscribeFunction

Properties

string

The ID of the current group.

Lists all windows in the group.

boolean

Whether the header of the group is visible or not.

object

Description

Flydown instance returned when creating flydown windows.

Properties

() => Promise<void>

Function that clears all flydown trigger zones from the window when invoked.

The options object used when the flydown was created.

object

Description

Settings that define the window download behavior.

Properties

boolean

If true, will autosave the file (without asking the user where to save it). If false, a system save dialog will appear.

Default: true

boolean

If true, will open the folder that contains the downloaded file after the download is completed.

Default: false

boolean

If true, will open the download file after the download is completed.

Default: false

boolean

If true, enables the window to download files.

Default: true

boolean

If true, a download bar tracking the progress will appear at the bottom of the window when downloading. If false, the download process will be invisible.

Default: true

object

Description

Window buttons settings.

Properties

string

Unique ID for the button.

number

Button position.

string

Button tooltip.

string

Button image in base64 format.

object

Description

Object describing the window bounds.

Properties

number

Vertical coordinate of the top left window corner.

number

Horizontal coordinate of the top left window corner.

number

Window width.

number

Window height.

object

Description

Object describing the size of the window.

Properties

number

Window width.

number

Window height.

object

Description

Options for creating flydown windows.

Properties

An array of defined zones which when triggered will show a flydown window.

Range where the flydown will remain active.

number

Default horizontal offset for all flydown zones.

number

Default vertical offset for all flydown zones.

The location ("bottom", "top", "left", "right" or "none") where the flydown will appear, relative to the defined flydown zone. If "none" is passed, the flydown will appear at { left: 0, top: 0 } of the flydown trigger zone.

string

The ID of the window which will be used as a flydown window.

Size | ((data: ShowFlydownData, cancel: () => void) => Promise<Size>)

The size of the rendered flydown window (width and height). Can be an object with a specific size, or a callback that calculates the size. The callback receives the flydown data and a function to cancel the flydown.

object

Description

Object describing a flydown window.

Properties

string

The ID of the zone which triggered the flydown.

The initial bounds of the flydown, if set before the callback is invoked. If not set, this defaults to { left: 0, top: 0, height: 200, width: 200}.

string

The ID of the window used as a flydown.

object

Description

Object describing a flydown trigger zone.

Properties

string

Unique ID of the flydown trigger zone.

Size | ((data: ShowFlydownData, cancel: () => void) => Promise<Size>)

The size of the rendered flydown window (width and height). Can be an object with a specific size, or a callback that calculates the size. The callback receives the flydown data and a function to cancel the flydown.

Bounds of the zone which can trigger a flydown window. These bounds are relative to the target window, so the coordinates { left: 0, top: 0 } correspond to the top left corner of the target window, rather than the top left corner of the monitor.

The location ("bottom", "top", "left", "right" or "none") where the flydown will appear, relative to the defined flydown zone. If "none" is passed, the flydown will appear at { left: 0, top: 0 } of the flydown trigger zone.

string

The ID of the window which will be used as a flydown window.

object

Properties

string

The name of the window - must be unique.

string

Required. The URL of the app to be loaded in the new window

number

Distance of the top left window corner from the top edge of the screen.

Default: 0

number

Distance of the top left window corner from the left edge of the screen.

Default: 0

number

Window width.

Default: 400

number

Window height.

Default: 400

boolean

If false, the window will not contain a close button.

Default: true

boolean

If false, the tab header will not contain a close button.

Default: true

boolean

If false, the window will not contain a collapse button.

Default: true

boolean

If false, the window will not contain an activity related forward button.

Default: true

boolean

If false, the window will not contain a maximize button.

Default: true

boolean

If false, the window will not contain a minimize button.

Default: true

boolean

If false, the window will not unstick from other windows.

Default: true

boolean

If false, the window will not contain a lock/unlock button.

Default: false

boolean

If true, when moving the window operation ends, the window will snap to one of the approaching edges of another window (if any of the approaching edges are marked with red).

Default: true

boolean

If true, a snapped window will adjust its bounds to the same width/height of the window it has stuck to, and/or will occupy the space between other windows (if any).

Default: true

string

Image as base64 encoded string that will be used as a taskbar icon for the window. The supported formats are png, ico, jpg, apng.

string

Can be a color name such as “red”, or a hex-encoded RGB or ARGB value.

number

Defines the height of the window when collapsed.

Default: -1

boolean

If true, allows opening a developer console (using F12) for the new window.

Default: true

Object that defines file download behavior in the window.

boolean

If true, the window will start collapsed.

Default: false

boolean

If true, the window will open as a popup, sharing the lifetime and the environment of the opener.

Default: false

boolean

If true, the window will stick to other Glue42 Windows forming groups.

Default: true

boolean

If false, the window will not be on focus when created.

Default: true

boolean

If false, the window cannot be moved.

Default: true

boolean

If false, the window cannot be resized by dragging its borders, maximizing, etc.

Default: true

boolean

If true, the window will be started as a hidden window.

Default: false

boolean

If true, this will allow the users to navigate back (CTRL+Left) and forward (CTRL+Right) through the web page history.

Default: true

number

Specifies the maximum window height.

number

Specifies the maximum window width.

number

Specifies the minimum window height.

Default: 30

number

Specifies the minimum window width.

Default: 50

Glue42 Window type. Possible values are flat, tab and html.

Default: "flat"

string

How much of the window area is to be considered as a moving area (meaning you can move the window using it). The string value corresponds to the left, top, right and bottom borders of the window. Setting moveAreaThickness to “0, 20, 0, 0” will set a 20 pixel thick move area at the top of the window.

Default: "0, 12, 0, 0"

string

Margin for the top window move area. The string value corresponds to the left, top, right and bottom borders of the move area. Setting moveAreaTopMargin to “10, 0, 0, 10” will take away 10 pixels from the left and the right side of the move area.

Default: "0, 0, 0, 0"

boolean

If true, the window will appear on top of the z-order.

Default: false

string

The ID of the window that will be used to relatively position the new window. Can be combined with relativeDirection.

Direction ("bottom", "top", "left", "right") of positioning the window relatively to the relativeTo window. Considered only if relativeTo is supplied.

Default: "right"

boolean

If false, the window will not appear on the Windows taskbar.

Default: true

boolean

Determines whether the window will have a title bar.

Default: true

string

How much of the window area is to be considered as a sizing area (meaning you can resize the window using that area). The string value corresponds to the left, top, right and bottom borders.

Default: "5, 5, 5, 5"

string

Specifies the active Glue42 Window snapping edges. Possible values are: top, left, right, bottom, all or any combination of them (e.g., left, right).

Default: "all"

string

Specifies the start window location. Possible options are Automatic (The Glue42 Window decides where the window will be positioned) and CenterScreen.

string

Specifies the Glue42 window frame color. Accepts hex color as string (e.g. "#666666") or named HTML colors (e.g. "red").

Default: "#5b8dc9"

string

If set, the Glue42 Window can only stick to windows that have the same group.

Default: "Any"

string

Specifies the tab group ID. If two or more tab windows are defined with the same ID, they will be hosted in the same tab window.

number

Specifies the tab position index. Tab windows in the same tab group are ordered by their position index. Use negative index to make the tab active.

boolean

Tab is selected.

Default: true

string

The tab title.

Default: ""

string

The tab tooltip.

Default: ""

string

Sets the window title. To work properly, there should be a title HTML tag in the page.

Object that defines loader behavior.

boolean

If true, this will set a random (from a predefined list of colors) frame color to the new window.

Default: false

If set, the window will start in the specified state (maximized, minimized, normal).

Default: "normal"

object

Description

Options for creating popup windows.

Properties

string

The ID of the window which will be used as a popup window.

The bounds of the area around which the popup will appear.

The size of the rendered popup window (width and height).

The location ("bottom", "top", "left", "right" or "none") where the popup will appear, relative to the defined popup area. If "none" is passed, the popup will appear at { left: 0, top: 0 } of the popup area.

number

The horizontal offset from the target bounds (applied only to left and right target locations).

number

The vertical offset from the target bounds (applied only to top and bottom target locations).

object

Description

Window loader settings.

Properties

boolean

Enable or disable the loader.

Default: true

boolean

Hide the loader once the page is loaded.

Default: true

number

Changes the loader animation speed.

Default: 1

string

Changes the background of the loader page.

Default: "#1C2D3B"

string

Type of the loading animation.

Default: "DoubleBounce"

number

Sets a specific size (in pixels) for the loader animation.

number

Sets a size factor for the loader animation relative to the window size.

Default: 0.3

string

Text that will show below the loader animation.

Default: "Loading"

number

Size of the loader text.

Default: 12

string

Color for the loader text.

Default: "#F1F1F1"

number

If set, will auto hide the loader after the specified period of time (in ms).

object

Description

Window settings for a window detached from a window group.

Properties

Position the new window relatively to an existing window.

Relative direction of positioning the new window. Considered only if relativeTo is supplied. Can be “bottom”, “top”, “left”, “right”.

number

Window width.

number

Window height.

Window bounds.

boolean

Whether to hide or show to window header.

object

Description

Options for capturing a display.

Properties

Size of the output image. Can be relative or absolute.

object

Description

Absolute size for the output image when capturing a display.

Properties

number

Image width.

number

Image height.

boolean

Specifies whether to keep the aspect ratio of the output image when you specify width and/or height of the output image. If true and both width and height are set, then the specified width will be used as a basis for the output image aspect ratio.

Default: true

object

Properties

number

Specifies the size of the output image relative to the actual screen size.

object

Description

Settings for Glue42 Windows.

Properties

number

Distance of the top left window corner from the top edge of the screen.

Default: 0

number

Distance of the top left window corner from the left edge of the screen.

Default: 0

number

Window width.

Default: 400

number

Window height.

Default: 400

boolean

If false, the window will not contain a close button.

Default: true

boolean

If false, the tab header will not contain a close button.

Default: true

boolean

If false, the window will not contain a collapse button.

Default: true

boolean

If false, the window will not contain an activity related forward button.

Default: true

boolean

If false, the window will not contain a maximize button.

Default: true

boolean

If false, the window will not contain a minimize button.

Default: true

boolean

If false, the window will not unstick from other windows.

Default: true

boolean

If false, the window will not contain a lock/unlock button.

Default: false

boolean

If true, when moving the window operation ends, the window will snap to one of the approaching edges of another window (if any of the approaching edges are marked with red).

Default: true

boolean

If true, a snapped window will adjust its bounds to the same width/height of the window it has stuck to, and/or will occupy the space between other windows (if any).

Default: true

string

Image as base64 encoded string that will be used as a taskbar icon for the window. The supported formats are png, ico, jpg, apng.

string

Can be a color name such as “red”, or a hex-encoded RGB or ARGB value.

number

Defines the height of the window when collapsed.

Default: -1

boolean

If true, allows opening a developer console (using F12) for the new window.

Default: true

Object that defines file download behavior in the window.

boolean

If true, the window will start collapsed.

Default: false

boolean

If true, the window will open as a popup, sharing the lifetime and the environment of the opener.

Default: false

boolean

If true, the window will stick to other Glue42 Windows forming groups.

Default: true

boolean

If false, the window will not be on focus when created.

Default: true

boolean

If false, the window cannot be moved.

Default: true

boolean

If false, the window cannot be resized by dragging its borders, maximizing, etc.

Default: true

boolean

If true, the window will be started as a hidden window.

Default: false

boolean

If true, this will allow the users to navigate back (CTRL+Left) and forward (CTRL+Right) through the web page history.

Default: true

number

Specifies the maximum window height.

number

Specifies the maximum window width.

number

Specifies the minimum window height.

Default: 30

number

Specifies the minimum window width.

Default: 50

Glue42 Window type. Possible values are flat, tab and html.

Default: "flat"

string

How much of the window area is to be considered as a moving area (meaning you can move the window using it). The string value corresponds to the left, top, right and bottom borders of the window. Setting moveAreaThickness to “0, 20, 0, 0” will set a 20 pixel thick move area at the top of the window.

Default: "0, 12, 0, 0"

string

Margin for the top window move area. The string value corresponds to the left, top, right and bottom borders of the move area. Setting moveAreaTopMargin to “10, 0, 0, 10” will take away 10 pixels from the left and the right side of the move area.

Default: "0, 0, 0, 0"

boolean

If true, the window will appear on top of the z-order.

Default: false

string

The ID of the window that will be used to relatively position the new window. Can be combined with relativeDirection.

Direction ("bottom", "top", "left", "right") of positioning the window relatively to the relativeTo window. Considered only if relativeTo is supplied.

Default: "right"

boolean

If false, the window will not appear on the Windows taskbar.

Default: true

boolean

Determines whether the window will have a title bar.

Default: true

string

How much of the window area is to be considered as a sizing area (meaning you can resize the window using that area). The string value corresponds to the left, top, right and bottom borders.

Default: "5, 5, 5, 5"

string

Specifies the active Glue42 Window snapping edges. Possible values are: top, left, right, bottom, all or any combination of them (e.g., left, right).

Default: "all"

string

Specifies the start window location. Possible options are Automatic (The Glue42 Window decides where the window will be positioned) and CenterScreen.

string

Specifies the Glue42 window frame color. Accepts hex color as string (e.g. "#666666") or named HTML colors (e.g. "red").

Default: "#5b8dc9"

string

If set, the Glue42 Window can only stick to windows that have the same group.

Default: "Any"

string

Specifies the tab group ID. If two or more tab windows are defined with the same ID, they will be hosted in the same tab window.

number

Specifies the tab position index. Tab windows in the same tab group are ordered by their position index. Use negative index to make the tab active.

boolean

Tab is selected.

Default: true

string

The tab title.

Default: ""

string

The tab tooltip.

Default: ""

string

Sets the window title. To work properly, there should be a title HTML tag in the page.

Object that defines loader behavior.

boolean

If true, this will set a random (from a predefined list of colors) frame color to the new window.

Default: false

If set, the window will start in the specified state (maximized, minimized, normal).

Default: "normal"

object

Properties

boolean

boolean

boolean

boolean

boolean

object

Properties

number

number

number

number

object

Properties

boolean

boolean

boolean

boolean

boolean

boolean

boolean

number

number

number

number

object

Description

Object describing a screen.

Properties

number

Screen height.

boolean

Whether this is the primary screen.

number

Horizontal coordinate of the top left corner of the screen.

string

Name of the screen assigned by the operating system.

number

Screen scale factor.

number

Scale factor of the horizontal axis of the screen.

number

Scale factor of the vertical axis of the screen.

number

Vertical coordinate of the top left corner of the screen.

number

Screen width.

number

Height of the working area.

number

Horizontal coordinate of the top left corner of the screen working area.

number

Vertical coordinate of the top left corner of the screen working area.

number

Width of the working area.

enumeration

Description

Location of the window (flydown or popup) relative to the defined trigger zone (flydown trigger zone or popup trigger area).

  • None
  • Left
  • Right
  • Top
  • Bottom

enumeration

Description

Relative direction of positioning the window.

  • "top"
  • "left"
  • "right"
  • "bottom"

enumeration

Description

Glue42 Window mode.

  • "html"
  • "flat"
  • "tab"

enumeration

Description

Window state.

  • "normal"
  • "maximized"
  • "minimized"