From 25576b51180a35f0cb3fcd8b5e1c57f03a3afc41 Mon Sep 17 00:00:00 2001 From: Geoffrey Booth Date: Sun, 22 Oct 2023 15:24:27 -0700 Subject: [PATCH] doc: explain how to disable navigator PR-URL: https://github.com/nodejs/node/pull/50310 Reviewed-By: Yagiz Nizipli Reviewed-By: Zeyu "Alex" Yang Reviewed-By: Moshe Atlow --- doc/api/globals.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/api/globals.md b/doc/api/globals.md index 233f5281e0a199..2a598baa81ffa5 100644 --- a/doc/api/globals.md +++ b/doc/api/globals.md @@ -600,7 +600,7 @@ This variable may appear to be global but is not. See [`module`][]. added: v21.0.0 --> -> Stability: 1 - Experimental +> Stability: 1.1 - Active development A partial implementation of the [Navigator API][]. @@ -610,10 +610,18 @@ A partial implementation of the [Navigator API][]. added: v21.0.0 --> -> Stability: 1 - Experimental +> Stability: 1.1 - Active development A partial implementation of [`window.navigator`][]. +If your app or a dependency uses a check for `navigator` to determine whether it +is running in a browser, the following can be used to delete the `navigator` +global before app code runs: + +```bash +node --import 'data:text/javascript,delete globalThis.navigator' app.js +``` + ### `navigator.hardwareConcurrency`