3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Tauri + React】リンクをブラウザで開く方法

Posted at

概要

TauriでリンクをOSのブラウザで開く方法です。普通にaタグのhrefにリンクを書くだけではもちろんTauriのアプリケーション内でリンクが開かれてしまいます。

解決法

aタグのtarget属性に_blankを設定してあげればブラウザで開くことができます。

App.tsx
return(
    <>
        <a href="https://~~">Tauriのアプリ内で開きます</a>
        <a href="https://~~" target="_blank">ブラウザで開けます</a>
    </>
)
3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?