W3cubDocs

/Web APIs

NavigatorUAData: toJSON() method

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The toJSON() method of the NavigatorUAData interface is a serializer that returns a JSON representation of the low entropy properties of the NavigatorUAData object.

Note: The terms high entropy and low entropy refer to the amount of information these values reveal about the browser. The low entropy values returned by this method are those which do not reveal information able to identify a user. High entropy values can only be returned by the NavigatorUAData.getHighEntropyValues() method.

Syntax

js

toJSON()

Parameters

None.

Return value

A JSON object.

Examples

The following example prints the JSON object to the console.

js

console.log(navigator.userAgentData.toJSON());

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
toJSON 93 93 No No 79 No No 93 No 66 No No

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/toJSON