Showing User's OS and Browser Name

Question:
How do we use Velo to show the name of a user’s browser and operating system in a text box?

Product:
All Wix editors (Classic, Editor X, Studio)

What are you trying to achieve:
We are trying to create a tool that shows a user’s browser and operating system.

What have you already tried:
We have tried using wix-window, but none of those options work for what we are trying to accomplish.

As of my knowledge Wix do not provide such API (functionality), but you can generate such a feature/function by your own → using either a Custom-Element, or a HTML-Component.

The fastest way would be to use a HTML-Component and put some code like the following into yout HTML-Component…

<!doctype html>
<html>
  <head>
    <title>Get Browser-Data</title>
    <script type="text/javascript">
      function init () {console.log('init running...');
        console.log("Browser CodeName: ", navigator.appCodeName);
        console.log("Browser Name: ", navigator.appName);
        console.log("Browser Version: ", navigator.appVersion);
        console.log("Cookies Enabled: ",navigator.cookieEnabled);
        console.log("Browser Language: ", navigator.language);
        console.log("Browser Online: ", navigator.onLine);
        console.log("Platform: ", navigator.platform);
        console.log("User-agent header: ", navigator.userAgent);
      }
    </script>
  </head>
  <body onload="init();" > </body>
</html>

This will give following data as example…
2023-11-12 23_27_44-JSFiddle - Code Playground

Once you have collected all needed data inside of the HTML-Component, you can send it back to your site.

This for, you will need to upgrade your code, to allow/enable communication between your Wix-Page and the HTML-Component. This way you open a smal window to the → WWW

On your Wix-Page you will need some code like this…

$w.onReady(()=>{
  $w("#html1").onMessage((event)=>{
  	let browserInfo=event.data; 
    console.log("BROWSER-INFO: " , browserInfo);
  });
  //--------------------------------------------
  $w('#yourButtonIDhere').onClick(()=>{
  	get_browserInfo();
  });
});
function get_browserInfo() {console.log('get_browserInfo running...'); 
	$w("#html1").postMessage("Get browser info");
}
Now all you need is to implement the code-part for communication to your Wix-Site inside your HTML-Component .... to be able to get all collected data from the HTML-Component.

Good luck!!!