tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[feat] add "Tauri/2.0" to original User Agent from web view which will be useful to decide whether the page is running on Tauri Environment

Open jyc5120 opened this issue 3 years ago • 2 comments

Describe the problem

Now we could use the windows.userAgent to set custom userAgent from tauri.config.json. but it will overwrite the original information. the original information is useful to get OS, devices, browser name. now we have to change the config for every different platform.

Describe the solution you'd like

Somewhere in webview component could be easy to add a Extra Information like Tauri/2.0 to user agent.

Alternatives considered

No response

Additional context

No response

jyc5120 avatar Nov 17 '23 19:11 jyc5120

you can just check if window.__TAURI__ is defined in v1, probably in v2, we will add an explicit const like window.isTauri

amrbashir avatar Nov 20 '23 13:11 amrbashir

@amrbashir need this for server side checks.

daveycodez avatar Apr 08 '25 03:04 daveycodez