webviewWindow
References
DragDropEvent
Re-exports DragDropEvent
DragDropPayload
Re-exports DragDropPayload
Classes
WebviewWindow
Create new webview or get a handle to an existing one.
Webviews are identified by a label a unique identifier that can be used to reference it later.
It may only contain alphanumeric characters a-zA-Z
plus the following special characters -
, /
, :
and _
.
Example
Since
2.0.0
Extends
Constructors
new WebviewWindow()
Creates a new Window hosting a Webview.
Parameters
Parameter | Type | Description |
---|---|---|
label | string | The unique webview label. Must be alphanumeric: a-zA-Z-/:_ . |
options | Omit <WebviewOptions , "width" | "height" | "x" | "y" > & WindowOptions | - |
Returns
The WebviewWindow instance to communicate with the window and webview.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/webviewWindow.ts#L73
Properties
Property | Type | Description | Inherited from |
---|---|---|---|
label | string | The webview label. It is a unique identifier for the webview, can be used to reference it later. | Window .label |
listeners | Record <string , EventCallback <any >[]> | Local event listeners. | Window .listeners |
window | Window | The window hosting this webview. | Webview .window |
Methods
center()
Centers the window.
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L800
clearEffects()
Clear any applied effects if possible.
Returns
Promise
<void
>
Inherited from
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1151
close()
Closes the webview.
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/webview.ts#L394
destroy()
Destroys the window. Behaves like Window.close but forces the window close instead of emitting a closeRequested event.
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1088
emit()
Emits an event to all targets.
Parameters
Parameter | Type | Description |
---|---|---|
event | string | Event name. Must include only alphanumeric characters, - , / , : and _ . |
payload ? | unknown | Event payload. |
Returns
Promise
<void
>
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/webview.ts#L283
emitTo()
Emits an event to all targets matching the given target.
Parameters
Parameter | Type | Description |
---|---|---|
target | string | EventTarget | Label of the target Window/Webview/WebviewWindow or raw EventTarget object. |
event | string | Event name. Must include only alphanumeric characters, - , / , : and _ . |
payload ? | unknown | Event payload. |
Returns
Promise
<void
>
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/webview.ts#L311
hide()
Sets the window visibility to false.
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1054
innerPosition()
The position of the top-left hand corner of the window’s client area relative to the top-left hand corner of the desktop.
Returns
The window’s inner position.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L518
innerSize()
The physical size of the window’s client area. The client area is the content of the window, excluding the title bar and borders.
Returns
The window’s inner size.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L551
isClosable()
Gets the window’s native close button state.
Platform-specific
- iOS / Android: Unsupported.
Returns
Promise
<boolean
>
Whether the window’s native close button is enabled or not.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L731
isDecorated()
Gets the window’s current decorated state.
Returns
Promise
<boolean
>
Whether the window is decorated or not.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L652
isFocused()
Gets the window’s current focus state.
Returns
Promise
<boolean
>
Whether the window is focused or not.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L636
isFullscreen()
Gets the window’s current fullscreen state.
Returns
Promise
<boolean
>
Whether the window is in fullscreen mode or not.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L590
isMaximizable()
Gets the window’s native maximize button state.
Platform-specific
- Linux / iOS / Android: Unsupported.
Returns
Promise
<boolean
>
Whether the window’s native maximize button is enabled or not.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L689
isMaximized()
Gets the window’s current maximized state.
Returns
Promise
<boolean
>
Whether the window is maximized or not.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L620
isMinimizable()
Gets the window’s native minimize button state.
Platform-specific
- Linux / iOS / Android: Unsupported.
Returns
Promise
<boolean
>
Whether the window’s native minimize button is enabled or not.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L710
isMinimized()
Gets the window’s current minimized state.
Returns
Promise
<boolean
>
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L604
isResizable()
Gets the window’s current resizable state.
Returns
Promise
<boolean
>
Whether the window is resizable or not.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L668
isVisible()
Gets the window’s current visible state.
Returns
Promise
<boolean
>
Whether the window is visible or not.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L747
listen()
Listen to an emitted event on this webivew window.
Type parameters
Type parameter |
---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
event | EventName | Event name. Must include only alphanumeric characters, - , / , : and _ . |
handler | EventCallback <T > | Event handler. |
Returns
A promise resolving to a function to unlisten to the event. Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/webviewWindow.ts#L153
maximize()
Maximizes the window.
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L958
minimize()
Minimizes the window.
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1006
onCloseRequested()
Listen to window close requested. Emitted when the user requests to closes the window.
Parameters
Parameter | Type |
---|---|
handler | (event ) => void | Promise <void > |
Returns
A promise resolving to a function to unlisten to the event. Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1698
onDragDropEvent()
Listen to a file drop event. The listener is triggered when the user hovers the selected files on the webview, drops the files or cancels the operation.
Parameters
Parameter | Type |
---|---|
handler | EventCallback <DragDropEvent > |
Returns
A promise resolving to a function to unlisten to the event. Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/webview.ts#L542
onFocusChanged()
Listen to window focus change.
Parameters
Parameter | Type |
---|---|
handler | EventCallback <boolean > |
Returns
A promise resolving to a function to unlisten to the event. Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1812
onMoved()
Listen to window move.
Parameters
Parameter | Type |
---|---|
handler | EventCallback <PhysicalPosition > |
Returns
A promise resolving to a function to unlisten to the event. Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1669
onResized()
Listen to window resize.
Parameters
Parameter | Type |
---|---|
handler | EventCallback <PhysicalSize > |
Returns
A promise resolving to a function to unlisten to the event. Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1645
onScaleChanged()
Listen to window scale change. Emitted when the window’s scale factor has changed. The following user actions can cause DPI changes:
- Changing the display’s resolution.
- Changing the display’s scale factor (e.g. in Control Panel on Windows).
- Moving the window to a display with a different scale factor.
Parameters
Parameter | Type |
---|---|
handler | EventCallback <ScaleFactorChanged > |
Returns
A promise resolving to a function to unlisten to the event. Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1852
onThemeChanged()
Listen to the system theme change.
Parameters
Parameter | Type |
---|---|
handler | EventCallback <Theme > |
Returns
A promise resolving to a function to unlisten to the event. Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1878
once()
Listen to an emitted event on this webview window only once.
Type parameters
Type parameter |
---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
event | string | Event name. Must include only alphanumeric characters, - , / , : and _ . |
handler | EventCallback <T > | Event handler. |
Returns
A promise resolving to a function to unlisten to the event. Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/webviewWindow.ts#L188
outerPosition()
The position of the top-left hand corner of the window relative to the top-left hand corner of the desktop.
Returns
The window’s outer position.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L534
outerSize()
The physical size of the entire window. These dimensions include the title bar and borders. If you don’t want that (and you usually don’t), use inner_size instead.
Returns
The window’s outer size.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L571
position()
The position of the top-left hand corner of the webview’s client area relative to the top-left hand corner of the desktop.
Returns
The webview’s position.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/webview.ts#L356
reparent()
Moves this webview to the given label.
Parameters
Parameter | Type |
---|---|
window | string | Window | WebviewWindow |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/webview.ts#L508
requestUserAttention()
Requests user attention to the window, this has no effect if the application
is already focused. How requesting for user attention manifests is platform dependent,
see UserAttentionType
for details.
Providing null
will unset the request for user attention. Unsetting the request for
user attention might not be done automatically by the WM when the window receives input.
Platform-specific
- macOS:
null
has no effect. - Linux: Urgency levels have the same effect.
Parameters
Parameter | Type |
---|---|
requestType | null | UserAttentionType |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L826
scaleFactor()
The scale factor that can be used to map physical pixels to logical pixels.
Returns
Promise
<number
>
The window’s monitor scale factor.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L502
setAlwaysOnBottom()
Whether the window should always be below other windows.
Parameters
Parameter | Type | Description |
---|---|---|
alwaysOnBottom | boolean | Whether the window should always be below other windows or not. |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1187
setAlwaysOnTop()
Whether the window should always be on top of other windows.
Parameters
Parameter | Type | Description |
---|---|---|
alwaysOnTop | boolean | Whether the window should always be on top of other windows or not. |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1169
setClosable()
Sets whether the window’s native close button is enabled or not.
Platform-specific
- Linux: GTK+ will do its best to convince the window manager not to show a close button. Depending on the system, this function may not have any effect when called on a window that is already visible
- iOS / Android: Unsupported.
Parameters
Parameter | Type |
---|---|
closable | boolean |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L923
setContentProtected()
Prevents the window contents from being captured by other apps.
Parameters
Parameter | Type |
---|---|
protected_ | boolean |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1204
setCursorGrab()
Grabs the cursor, preventing it from leaving the window.
There’s no guarantee that the cursor will be hidden. You should hide it by yourself if you want so.
Platform-specific
- Linux: Unsupported.
- macOS: This locks the cursor in a fixed location, which looks visually awkward.
Parameters
Parameter | Type | Description |
---|---|---|
grab | boolean | true to grab the cursor icon, false to release it. |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1448
setCursorIcon()
Modifies the cursor icon of the window.
Parameters
Parameter | Type | Description |
---|---|---|
icon | CursorIcon | The new cursor icon. |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1490
setCursorPosition()
Changes the position of the cursor in window coordinates.
Parameters
Parameter | Type | Description |
---|---|---|
position | LogicalPosition | PhysicalPosition | The new cursor position. |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1508
setCursorVisible()
Modifies the cursor’s visibility.
Platform-specific
- Windows: The cursor is only hidden within the confines of the window.
- macOS: The cursor is hidden as long as the window has input focus, even if the cursor is outside of the window.
Parameters
Parameter | Type | Description |
---|---|---|
visible | boolean | If false , this will hide the cursor. If true , this will show the cursor. |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1472
setDecorations()
Whether the window should have borders and bars.
Parameters
Parameter | Type | Description |
---|---|---|
decorations | boolean | Whether the window should have borders and bars. |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1105
setEffects()
Set window effects.
Parameters
Parameter | Type |
---|---|
effects | Effects |
Returns
Promise
<void
>
Inherited from
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1141
setFocus()
Bring the webview to front and focus.
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/webview.ts#L475
setFullscreen()
Sets the window fullscreen state.
Parameters
Parameter | Type | Description |
---|---|---|
fullscreen | boolean | Whether the window should go to fullscreen or not. |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1357
setIcon()
Sets the window icon.
Parameters
Parameter | Type | Description |
---|---|---|
icon | | string | number [] | ArrayBuffer | Uint8Array | Image | Icon bytes or path to the icon file. |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Note that you need the image-ico
or image-png
Cargo features to use this API.
To enable it, change your Cargo.toml file:
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1398
setIgnoreCursorEvents()
Changes the cursor events behavior.
Parameters
Parameter | Type | Description |
---|---|---|
ignore | boolean | true to ignore the cursor events; false to process them as usual. |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1544
setMaxSize()
Sets the window maximum inner size. If the size
argument is undefined, the constraint is unset.
Parameters
Parameter | Type | Description |
---|---|---|
size | undefined | null | LogicalSize | PhysicalSize | The logical or physical inner size, or null to unset the constraint. |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1287
setMaximizable()
Sets whether the window’s native maximize button is enabled or not. If resizable is set to false, this setting is ignored.
Platform-specific
- macOS: Disables the “zoom” button in the window titlebar, which is also used to enter fullscreen mode.
- Linux / iOS / Android: Unsupported.
Parameters
Parameter | Type |
---|---|
maximizable | boolean |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L878
setMinSize()
Sets the window minimum inner size. If the size
argument is not provided, the constraint is unset.
Parameters
Parameter | Type | Description |
---|---|---|
size | undefined | null | LogicalSize | PhysicalSize | The logical or physical inner size, or null to unset the constraint. |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1252
setMinimizable()
Sets whether the window’s native minimize button is enabled or not.
Platform-specific
- Linux / iOS / Android: Unsupported.
Parameters
Parameter | Type |
---|---|
minimizable | boolean |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L900
setPosition()
Sets the webview position.
Parameters
Parameter | Type | Description |
---|---|---|
position | LogicalPosition | PhysicalPosition | The new position, in logical or physical pixels. |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/webview.ts#L441
setProgressBar()
Sets the taskbar progress state.
Platform-specific
- Linux / macOS: Progress bar is app-wide and not specific to this window.
- Linux: Only supported desktop environments with
libunity
(e.g. GNOME).
Parameters
Parameter | Type |
---|---|
state | ProgressBarState |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1603
setResizable()
Updates the window resizable flag.
Parameters
Parameter | Type |
---|---|
resizable | boolean |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L854
setShadow()
Whether or not the window should have shadow.
Platform-specific
- Windows:
false
has no effect on decorated window, shadows are always ON.true
will make ndecorated window have a 1px white border, and on Windows 11, it will have a rounded corners.
- Linux: Unsupported.
Parameters
Parameter | Type |
---|---|
enable | boolean |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1131
setSize()
Resizes the webview.
Parameters
Parameter | Type | Description |
---|---|---|
size | LogicalSize | PhysicalSize | The logical or physical size. |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/webview.ts#L411
setSkipTaskbar()
Whether the window icon should be hidden from the taskbar or not.
Platform-specific
- macOS: Unsupported.
Parameters
Parameter | Type | Description |
---|---|---|
skip | boolean | true to hide window icon, false to show it. |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1422
setTitle()
Sets the window title.
Parameters
Parameter | Type | Description |
---|---|---|
title | string | The new title |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L941
setVisibleOnAllWorkspaces()
Sets whether the window should be visible on all workspaces or virtual desktops.
Platform-specific
- Windows / iOS / Android: Unsupported.
Parameters
Parameter | Type |
---|---|
visible | boolean |
Returns
Promise
<void
>
Inherited from
Window
.setVisibleOnAllWorkspaces
Since
2.0.0
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1619
setZoom()
Set webview zoom level.
Parameters
Parameter | Type |
---|---|
scaleFactor | number |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/webview.ts#L491
show()
Sets the window visibility to true.
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1038
size()
The physical size of the webview’s client area. The client area is the content of the webview, excluding the title bar and borders.
Returns
The webview’s size.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/webview.ts#L373
startDragging()
Starts dragging the window.
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1561
startResizeDragging()
Starts resize-dragging the window.
Parameters
Parameter | Type |
---|---|
direction | ResizeDirection |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1577
theme()
Gets the window’s current theme.
Platform-specific
- macOS: Theme was introduced on macOS 10.14. Returns
light
on macOS 10.13 and below.
Returns
The window theme.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L782
title()
Gets the window’s current title.
Returns
Promise
<string
>
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L761
toggleMaximize()
Toggles the window maximized state.
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L990
unmaximize()
Unmaximizes the window.
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L974
unminimize()
Unminimizes the window.
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/window.ts#L1022
getAll()
Gets a list of instances of Webview
for all available webviews.
Returns
Inherited from
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/webviewWindow.ts#L129
getByLabel()
Gets the Webview for the webview associated with the given label.
Parameters
Parameter | Type | Description |
---|---|---|
label | string | The webview label. |
Returns
null
| WebviewWindow
The Webview instance to communicate with the webview or null if the webview doesn’t exist.
Inherited from
Example
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/webviewWindow.ts#L110
getCurrent()
Get an instance of Webview
for the current webview.
Returns
Inherited from
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/webviewWindow.ts#L122
Functions
getAll()
Gets a list of instances of Webview
for all available webview windows.
Returns
Since
2.0.0
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/webviewWindow.ts#L34
getCurrent()
Get an instance of Webview
for the current webview window.
Returns
Since
2.0.0
Source: https://github.com/tauri-apps/tauri/blob/dev/tooling/api/src/webviewWindow.ts#L23
© 2024 Tauri Contributors. CC-BY / MIT