@tauri-apps/plugin-opener
Esta página aún no está disponible en tu idioma.
Open files and URLs using their default application.
Security
This API has a scope configuration that forces you to restrict the files and urls to be opened.
Restricting access to the open | open
API
On the configuration object, open: true
means that the open API can be used with any URL,
as the argument is validated with the ^((mailto:\w+)|(tel:\w+)|(https?://\w+)).+
regex.
You can change that regex by changing the boolean value to a string, e.g. open: ^https://github.com/
.
Functions
openPath()
Opens a path with the system’s default app, or the one specified with openWith.
Parameters
Parameter | Type | Description |
---|---|---|
path | string | The path to open. |
openWith ? | string | The app to open the path with. If not specified, defaults to the system default application for the specified path type. |
Returns
Promise
<void
>
Example
Since
2.0.0
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/opener/guest-js/index.ts#L66
openUrl()
Opens a url with the system’s default app, or the one specified with openWith.
Parameters
Parameter | Type | Description |
---|---|---|
url | string | The URL to open. |
openWith ? | string | The app to open the URL with. If not specified, defaults to the system default application for the specified url type. |
Returns
Promise
<void
>
Example
Since
2.0.0
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/opener/guest-js/index.ts#L41
revealItemInDir()
Reveal a path with the system’s default explorer.
Platform-specific:
- Android / iOS: Unsupported.
Parameters
Parameter | Type | Description |
---|---|---|
path | string | The path to reveal. |
Returns
Promise
<unknown
>
Example
Since
2.0.0
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/opener/guest-js/index.ts#L90
© 2025 Tauri Contributors. CC-BY / MIT