#tauri #tauri-plugin #url #browser #blank #target #default

sys tauri-plugin-openurl

open url in default browser (just like target blank) in Tauri

3 releases

0.1.0-beta.3 Apr 24, 2024
0.1.0-beta.2 Apr 9, 2024
0.1.0-beta.1 Apr 8, 2024

#3 in #blank

Download history 216/week @ 2024-04-08 139/week @ 2024-04-22

355 downloads per month

MIT license

20KB
305 lines

Crates.io Version Crates.io Total Downloads NPM Version NPM Downloads

Tauri Plugin openurl

Open url in browser on all platforms1 (excluding IOS, still in testing). Basically <a target="_blank"></a> replacement for all platforms1.

Usage

This plugin is still part of Tauri V2 Beta. So, this project might be replaced by a fix in Tauri core itself before project is stable.

Setup

npm

npm i tauri-plugin-openurl-api

&& cargo (possibly inside ./src-tauri/)

cargo add tauri-plugin-openurl

Usage

import { open_url } from "tauri-plugin-openurl-api";

<button onClick={() => {
    open_url("https://crates.io/crates/tauri-plugin-openurl");
}}>Click to open in default browser</button>

Permissions

Please make sure you add this permission to all platforms you intend to use in

{
  "permissions": [
    "openurl:allow-open-url"
  ]
}

References:

1 : excluding IOS as it is still in testing.

Dependencies

~16–60MB
~1M SLoC