Skip to content

How can I detect if I'm running the frontend in a browser? #6119

Answered by FabianLars
mettz asked this question in Q&A
Discussion options

You must be logged in to vote

You can check if window.__TAURI__ exists.

if (window.__TAURI__) {
  // inside tauri
}

Replies: 4 comments 7 replies

Comment options

You must be logged in to vote
2 replies
@mettz
Comment options

@elibroftw
Comment options

Answer selected by mettz
Comment options

You must be logged in to vote
4 replies
@FabianLars
Comment options

@intfract
Comment options

@liyasthomas
Comment options

@FabianLars
Comment options

Comment options

You must be logged in to vote
1 reply
@Muhammed-Rahif
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
9 participants