Skip to content

Commit 187e904

Browse files
Add openUrl function to opener documentation (#3582)
1 parent 84b6839 commit 187e904

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/content/docs/plugin/opener.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,16 @@ The opener plugin is available in both JavaScript and Rust.
8181
<TabItem label="JavaScript" >
8282

8383
```javascript
84-
import { openPath } from '@tauri-apps/plugin-opener';
84+
import { openPath, openUrl } from '@tauri-apps/plugin-opener';
8585
// when using `"withGlobalTauri": true`, you may use
8686
// const { openPath } = window.__TAURI__.opener;
8787

8888
// opens a file using the default program:
8989
await openPath('/path/to/file');
9090
// opens a file using `vlc` command on Windows:
9191
await openPath('C:/path/to/file', 'vlc');
92+
// opens a URL using the default program:
93+
await openURL('https://tauri.app');
9294
```
9395

9496
</TabItem>
@@ -103,6 +105,8 @@ use tauri_plugin_opener::OpenerExt;
103105
app.opener().open_path("/path/to/file", None::<&str>);
104106
// opens a file using `vlc` command on Windows:
105107
app.opener().open_path("C:/path/to/file", Some("vlc"));
108+
// opens a URL using the default program:
109+
app.opener().open_url("https://tauri.app", None::<&str>);
106110
```
107111

108112
</TabItem>

0 commit comments

Comments
 (0)