summaryrefslogtreecommitdiff
path: root/lib/internal/bootstrap/node.js
diff options
context:
space:
mode:
authorYagiz Nizipli <yagiz@nizipli.com>2023-04-28 12:21:01 -0400
committerYagiz Nizipli <yagiz@nizipli.com>2023-04-28 14:59:39 -0400
commiteb7379b62e356d973c91a2c1d433d8d2770cee18 (patch)
treeb763546dfc65fc860b7fb5dbfe2ffaa73328c264 /lib/internal/bootstrap/node.js
parentb31d587dc8c1b0f459243d2b96a17a7175c996cf (diff)
downloadnode-new-navigator-platform.tar.gz
lib: add `navigator.platform`navigator-platform
Co-authored-by: Mestery <mestery@protonmail.com> Co-authored-by: Voltrex <mohammadkeyvanzade94@gmail.com>
Diffstat (limited to 'lib/internal/bootstrap/node.js')
-rw-r--r--lib/internal/bootstrap/node.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js
index 41a833885f..e25e0405c7 100644
--- a/lib/internal/bootstrap/node.js
+++ b/lib/internal/bootstrap/node.js
@@ -224,6 +224,15 @@ defineLazyProperties(
['structuredClone'],
);
+// https://html.spec.whatwg.org/multipage/system-state.html#the-navigator-object
+ObjectDefineProperty(globalThis, 'navigator', {
+ __proto__: null,
+ enumerable: true,
+ configurable: true,
+ writable: false,
+ value: require('internal/navigator'),
+});
+
// Set the per-Environment callback that will be called
// when the TrackingTraceStateObserver updates trace state.
// Note that when NODE_USE_V8_PLATFORM is true, the observer is