From 1704a23520b643c3f756bc6aa88f298daa61bb51 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Mon, 16 Oct 2023 13:03:44 -0400 Subject: [PATCH] lib: add `navigator.userAgent` --- doc/api/globals.md | 15 +++++++++++++++ lib/internal/navigator.js | 9 +++++++++ test/parallel/test-navigator.js | 1 + 3 files changed, 25 insertions(+) diff --git a/doc/api/globals.md b/doc/api/globals.md index 01a6d9327a1669..1607fdb7db6069 100644 --- a/doc/api/globals.md +++ b/doc/api/globals.md @@ -629,6 +629,21 @@ logical processors available to the current Node.js instance. console.log(`This process is running on ${navigator.hardwareConcurrency}`); ``` +### `navigator.userAgent` + + + +* {string} + +The `navigator.userAgent` read-only property returns user agent +consisting of the runtime name and the version. + +```js +console.log(`The user-agent is ${navigator.userAgent}`); +``` + ## `PerformanceEntry`