Back to Content

NavigatorUAData: mobile property

files/en-us/web/api/navigatoruadata/mobile/index.md

latest700 B
Original Source

{{APIRef("User-Agent Client Hints API")}}{{SeeCompatTable}}{{AvailableInWorkers}}

The mobile read-only property of the {{domxref("NavigatorUAData")}} interface returns a value indicating whether the device is a mobile device.

Value

A {{jsxref("Boolean")}}, true if this is a mobile device.

Examples

The following example prints the value of mobile to the console.

js
console.log(navigator.userAgentData.mobile);

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also