API
Methods for querying and manipulating elements pertaining to a native ToDesktop window shell.
Remarks
This package exposes a number of methods for querying and manipulating elements pertaining to a native ToDesktop window shell.
Functions
addBrowserView()
Adds a BrowserView to the reference BrowserWindow.
Signature:
Parameters
Returns:
Promise<void>
areTabsSupported()
Signature:
Returns:
Promise<boolean>
blur()
Removes the current window from focus on the user's desktop.
Signature:
Returns:
Promise<void>
close()
Close the BrowserWindow corresponding to the ref
.
Signature:
Parameters
Returns:
Promise<void>
create()
Creates a new BrowserWindow.
Signature:
Parameters
Returns:
Promise<Ref>
Identifier for the newly created BrowserWindow.
createNewTab()
Creates a new tab and loads the pre-defined app URL.
Signature:
Returns:
Promise<void>
destroy()
Destroys the BrowserWindow corresponding to the ref
.
Signature:
Parameters
Returns:
Promise<void>
enterFullscreen()
Enters fullscreen mode on the current ToDesktop window.
Signature:
Returns:
Promise<void>
Example
exitFullscreen()
Exits fullscreen mode on the current ToDesktop window.
Signature:
Returns:
Promise<void>
Example
focus()
Causes the current window to be focussed on the user's desktop.
Signature:
Returns:
Promise<void>
getAllWindows()
Signature:
Returns:
Promise<InstanceRefObject[]>
An array of all opened browser windows.
getSize()
Gets the width and height of the reference browser window
Signature:
Parameters
Returns:
Promise<number[]>
getTitle()
The title of the native window.
Signature:
Parameters
Returns:
Promise<string>
getWebContents()
Get a WebContents reference for a BrowserWindow. WebContents is responsible for rendering and controlling a web page
Signature:
Parameters
Returns:
Promise<InstanceRefObject>
hide()
Hides the BrowserWindow corresponding to the ref
.
Signature:
Parameters
Returns:
Promise<void>
isFullscreen()
Returns true
if the current ToDesktop window is in fullscreen mode.
Signature:
Returns:
Promise<boolean>
Example
isMaximized()
Returns true
if the current ToDesktop window is maximized.
Signature:
Returns:
Promise<boolean>
isMinimized()
Returns true
if the current ToDesktop window is minimized.
Signature:
Returns:
Promise<boolean>
maximize()
Maximises the current ToDesktop window.
Signature:
Returns:
Promise<void>
minimize()
Minimize the current window.
Signature:
Returns:
Promise<void>
reload()
Reloads the web page.
Signature:
Parameters
Returns:
Promise<void>
removeBrowserView()
Removes a BrowserView from the reference BrowserWindow.
Signature:
Parameters
Returns:
Promise<void>
restore()
Unminimize the current window.
Signature:
Returns:
Promise<void>
setAlwaysOnTop()
Sets whether the window should show always on top of other windows. After setting this, the window is still a normal window, not a toolbox window which can not be focused on.
Signature:
Parameters
Returns:
Promise<void>
setBrowserView()
Sets a BrowserView on the reference BrowserWindow. If there are other BrowserViews attached, they will be removed from the window.
Signature:
Parameters
Returns:
Promise<void>
setContentProtection()
Prevents the window contents from being captured by other apps.
Signature:
Parameters
Returns:
Promise<void>
setIcon()
Changes window icon.
Signature:
Parameters
Returns:
Promise<void>
setProgressBar()
Signature:
Parameters
Returns:
Promise<void>
setTitle()
Changes the title of the reference BrowserWindow.
Signature:
Parameters
Returns:
Promise<void>
show()
Shows the BrowserWindow corresponding to the ref
.
Signature:
Parameters
Returns:
Promise<void>
unmaximize()
Minimizes the current ToDesktop window.
Signature:
Returns:
Promise<void>
Variables
on
Signature:
removeAllListeners
Signature:
Type Aliases
LegacyNativeWindowEvent
EVENTS
Signature:
NativeWindowEvents
Signature: