recursal/MDN huggingface dataset:
Navigator: webdriver property
=============================

 The **`webdriver`** read-only property
 of the `navigator` interface indicates whether the user agent is
 controlled by automation.

 It defines a standard way for co-operating user agents to inform the document that it
 is controlled by WebDriver, for example, so that
 alternate code paths can be triggered during automation.

The `navigator.webdriver` property is true when in:

Chrome

 The `--enable-automation` or the `--headless` flag or the
 `--remote-debugging-port` is used.


Firefox

 The `marionette.enabled` preference or `--marionette` flag is
 passed.


Value
-----

A `Boolean`

Specifications
--------------

| Specification |
| --- |
| WebDriver # dfn-webdriver |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
Navigator: cookieEnabled property
=================================

`navigator.cookieEnabled` returns a Boolean value that indicates whether cookies are enabled or not.

The property is read-only.

Value
-----

A boolean.

**Note:** When the browser is configured to block third-party cookies, and `navigator.cookieEnabled` is invoked inside a third-party iframe, it returns `true` in Safari, Edge Spartan and IE (while trying to set a cookie in such scenario would fail). It returns `false` in Firefox and Chromium-based browsers.

**Note:** Web browsers may prevent writing certain cookies in certain scenarios. For example, Chrome-based browsers, as well as some experimental version of Firefox, does not allow creating cookies with `SameSite=None` attribute, unless they are created over HTTPS and with `Secure` attribute.

Examples
--------


```js
if (!navigator.cookieEnabled) {
  // The browser does not support or is blocking cookies from being set.
}
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-navigator-cookieenabled-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
Navigator: appCodeName property
===============================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

 The value of the **`Navigator.appCodeName`** property is
 always "`Mozilla`", in any browser. This property is kept only for
 compatibility purposes.


**Note:** Do not rely on this property to return a real
 product name. All browsers return "`Mozilla`" as the value of this property.


Value
-----

The string "`Mozilla`".

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-navigator-appcodename-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `Navigator.appName`
* `Navigator.product`
Navigator: gpu property
=======================

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

The **`Navigator.gpu`** read-only property returns the `GPU` object for the current browsing context, which is the entry point for the WebGPU API.

Value
-----

An `GPU` object.

Examples
--------


```js
async function init() {
  if (!navigator.gpu) {
    throw Error("WebGPU not supported.");
  }

  const adapter = await navigator.gpu.requestAdapter();
  if (!adapter) {
    throw Error("Couldn't request WebGPU adapter.");
  }

  const device = await adapter.requestDevice();

  //...
}
```

Specifications
--------------

| Specification |
| --- |
| WebGPU # navigator-gpu |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* WebGPU API
Navigator: bluetooth property
=============================

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

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The **`bluetooth`** read-only property of the `Navigator` interface returns a `Bluetooth` object for the current document, providing access to Web Bluetooth API functionality.

Value
-----

A `Bluetooth` object.

Specifications
--------------

| Specification |
| --- |
| Web Bluetooth # dom-navigator-bluetooth |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Web Bluetooth API
Navigator: usb property
=======================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
The **`usb`** read-only property of the `Navigator` interface returns a `USB` object for the current document, providing access to WebUSB API functionality.

Value
-----

A `USB` object.

Specifications
--------------

| Specification |
| --- |
| WebUSB API # dom-navigator-usb |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* WebUSB API
Navigator: unregisterProtocolHandler() method
=============================================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The **`Navigator`** method **`unregisterProtocolHandler()`** removes a protocol handler for a given URL scheme.

This method is the inverse of **`registerProtocolHandler()`**.

Syntax
------


```js
unregisterProtocolHandler(scheme, url)
```

### Parameters

`scheme`

 A string containing the permitted scheme in the protocol handler that will be unregistered.
 For example, you can unregister the handler for SMS text message links by passing the `"sms"` scheme.


`url`

 A string containing the URL of the handler.
 **This URL should match the one that was used to register the handler (e.g. it must include `%s`)**.


### Return value

None (`undefined`).

### Exceptions

`SecurityError` `DOMException`

 The user agent blocked unregistration.
 This might happen if:


* The scheme (protocol) is invalid, such as a scheme the browser handles itself (`https:`, `about:`, etc.)
* The handler URL's origin does not match the origin of the page calling this API.
* The browser requires that this function is called from a secure context.
* The browser requires that the handler's URL be over HTTPS.

`SyntaxError` `DOMException`

The `%s` placeholder is missing from the handler URL.

Permitted schemes
-----------------

For security reasons, `unregisterProtocolHandler()` restricts which schemes can be unregistered.

A **custom scheme** may be unregistered as long as:

* The custom scheme's name begins with `web+`
* The custom scheme's name includes at least 1 letter after the `web+` prefix
* The custom scheme has only lowercase ASCII letters in its name.

For example, `web+burger`, as shown in the Example below.

Otherwise, the scheme must be one of the following:

* `bitcoin`
* `ftp`
* `ftps`
* `geo`
* `im`
* `irc`
* `ircs`
* `magnet`
* `mailto`
* `matrix`
* `mms`
* `news`
* `nntp`
* `openpgp4fpr`
* `sftp`
* `sip`
* `sms`
* `smsto`
* `ssh`
* `tel`
* `urn`
* `webcal`
* `wtai`
* `xmpp`
Examples
--------

If your site is `burgers.example.com`, and you have a `web+burger:` scheme, you can unregister the handler for it like so:


```js
navigator.unregisterProtocolHandler(
  "web+burger",
  "https://burgers.example.com/?burger=%s",
);
```


This script must be run from the same origin as the handler URL (so any page at `https://burgers.example.com`), and the handler URL must be `http` or `https`.

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-navigator-unregisterprotocolhandler-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
Navigator: serviceWorker property
=================================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The **`serviceWorker`** read-only property of the `Navigator` interface returns the `ServiceWorkerContainer` object for the associated document, which provides access to registration, removal, upgrade, and communication with the `ServiceWorker`.

The feature may not be available in private mode.

Value
-----

`ServiceWorkerContainer`.

Examples
--------

This code checks if the browser supports service workers.


```js
if ("serviceWorker" in navigator) {
  // Supported!
}
```

Specifications
--------------

| Specification |
| --- |
| Service Workers # navigator-service-worker-attribute |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Service Worker API
* Using Service Workers
Navigator: onLine property
==========================

 Returns the online status of the browser. The property returns a boolean value, with
 `true` meaning online and `false` meaning offline. The property
 sends updates whenever the browser's ability to connect to the network changes. The
 update occurs when the user follows links or when a script requests a remote page. For
 example, the property should return `false` when users click links soon after
 they lose internet connection.

Browsers implement this property differently.

 In Chrome and Safari, if the browser is not able to connect to a local area network
 (LAN) or a router, it is offline; all other conditions return `true`. So
 while you can assume that the browser is offline when it returns a `false`
 value, you cannot assume that a true value necessarily means that the browser can access
 the internet. You could be getting false positives, such as in cases where the computer
 is running a virtualization software that has virtual ethernet adapters that are always
 "connected." Therefore, if you really want to determine the online status of the
 browser, you should develop additional means for checking.

 In Firefox, switching the browser to offline mode sends a `false` value. Until Firefox
 41, all other conditions returned a `true` value; testing actual behavior on Nightly 68 on
 Windows shows that it only looks for LAN connection like Chrome and Safari giving false
 positives.

You can see changes in the network state by listening to the `online` and `offline` events.

Value
-----

A boolean.

Examples
--------

### Basic usage

 To check if you are online, query `window.navigator.onLine`, as in the
 following example:


```js
if (navigator.onLine) {
  console.log("online");
} else {
  console.log("offline");
}
```


 If the browser doesn't support `navigator.onLine` the above example will
 always come out as `false`/`undefined`.

### Listening for changes in network status

 To see changes in the network state, use
 `addEventListener` to
 listen for the events on `window.online` and `window.offline`, as
 in the following example:


```js
window.addEventListener("offline", (e) => {
  console.log("offline");
});

window.addEventListener("online", (e) => {
  console.log("online");
});
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-navigator-online-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
Navigator: wakeLock property
============================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

 The **`wakeLock`** read-only property of the `Navigator` interface returns a `WakeLock` interface that allows a document to acquire a screen wake lock.
 While a screen wake lock is active, the user agent will try to prevent the device from dimming the screen, turning it off completely, or showing a screensaver.

Syntax
------


```js
navigator.wakeLock
```

Specifications
--------------

| Specification |
| --- |
| Screen Wake Lock API # extensions-to-the-navigator-interface |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `WakeLock.request()`
* Screen Wake Lock API
* Stay awake with the Screen Wake Lock API
Navigator: locks property
=========================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

 The **`locks`** read-only property of
 the `Navigator` interface returns a `LockManager` object
 which provides methods for requesting a new `Lock` object and querying
 for an existing `Lock` object.

Value
-----

A `LockManager` object.

Specifications
--------------

| Specification |
| --- |
| Web Locks API # dom-navigatorlocks-locks |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
Navigator: windowControlsOverlay property
=========================================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

 The **`windowControlsOverlay`** read-only property of the `Navigator`
 interface returns the `WindowControlsOverlay` interface, which exposes
 information about the title bar geometry in desktop Progressive Web Apps that use the Window Controls Overlay API.

 Progressive Web Apps installed on desktop Operating Systems can opt-in to the
 Window Controls Overlay feature by using the `window-controls-overlay` value in the
 `display_override` web app manifest member.

 Doing so hides the default window title bar and gives the app access to the full area
 of the app window.

Value
-----

The `WindowControlsOverlay` interface.

Examples
--------


```js
if ("windowControlsOverlay" in navigator) {
  const rect = navigator.windowControlsOverlay.getTitlebarAreaRect();
  // Do something with the title bar area rectangle.
} else {
  // The Window Controls Overlay feature is not available.
}
```

Specifications
--------------

| Specification |
| --- |
| Window Controls Overlay # windowcontrolsoverlay-interface |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
Navigator: hid property
=======================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`Navigator.hid`**
 read-only property returns an `HID` object providing methods
 for connecting to HID devices, listing attached HID devices, and event
 handlers for connected HID devices.

Where a defined Permissions Policy blocks WebHID usage, the `Navigator.hid` property will not be available.

Value
-----

An `HID` object.

Specifications
--------------

| Specification |
| --- |
| WebHID API # dom-navigator-hid |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* WebHID API
Navigator: presentation property
================================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

 The `presentation` read-only property of `Navigator` serves as the entry
 point for the Presentation API and
 returns a reference to `Presentation` object.

Syntax
------


```js
const presentation = navigator.presentation
```

### Value

A reference to `Presentation` object.

Specifications
--------------

| Specification |
| --- |
| Presentation API # dom-navigator-presentation |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Presentation API
* `Presentation`
Navigator: globalPrivacyControl property
========================================

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

**Non-standard:** This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

 The **`Navigator.globalPrivacyControl`** read-only property returns the user's Global Privacy Control setting for the current website.
 This setting indicates whether the user consents to the website or service selling or sharing their personal information with third parties.

The value of the property reflects that of the `Sec-GPC` HTTP header.

Value
-----

`true` if the user explicitly *does not* provide consent to sell or share their data.
 `false` if the user either grants consent, or has not indicated a preference.

Example
-------


```js
console.log(navigator.globalPrivacyControl);
// "true" if the user has specifically indicated they do not want their data shared or sold, otherwise "false".
```

Specifications
--------------

#### No specification found

No specification data found for `api.Navigator.globalPrivacyControl`.  
Check for problems with this page or contribute a missing `spec_url` to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `Sec-GPC` header
* globalprivacycontrol.org
* Global Privacy Control Spec
* Do Not Track on Wikipedia
Navigator: productSub property
==============================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

 The **`Navigator.productSub`** read-only property returns the
 build number of the current browser.

Value
-----

A string.

Examples
--------


```js
document.body.textContent = `productSub: ${navigator.productSub}`;
```

Notes
-----

On IE, this property returns undefined.

On Apple Safari and Google Chrome this property always returns `20030107`.

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-navigator-productsub-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
Navigator: xr property
======================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

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

 The read-only **`xr`** property
 provided by the `Navigator` interface returns an `XRSystem` object
 which can be used to access the WebXR Device API.

Value
-----

 The `XRSystem` object used to interface with the WebXR Device API in the current
 context. This can be used to present augmented and/or virtual reality imagery to the
 user.

Examples
--------

 Each `Window` has its own instance of `Navigator`, which can
 be accessed as `window.navigator` or as
 `navigator`. At the same time, a new
 `XRSystem` instance is also created and attached to
 the `navigator` instance as `navigator.xr`. If
 the `xr` property exists, you can use it to access the WebXR Device API.

To determine if WebXR is available, you can do something like this:


```js
if ("xr" in window.navigator) {
  /\* WebXR can be used! \*/
} else {
  /\* WebXR isn't available \*/
}
```

Specifications
--------------

| Specification |
| --- |
| WebXR Device API # navigator-xr-attribute |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* WebGL API: 2D and 3D accelerated
 graphics for the web
* Canvas API: 2D graphics API
Navigator: serial property
==========================

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

The **`serial`** read-only property of the `Navigator` interface returns a `Serial` object which represents the entry point into the `Web Serial API`.

When getting, the same instance of the `Serial` object will always be returned.

Value
-----

A `Serial` object.

Examples
--------

The following example uses the `getPorts()` method to initialize a list of available ports.


```js
navigator.serial.getPorts().then((ports) => {
  // Initialize the list of available ports with `ports` on page load.
});
```

Specifications
--------------

| Specification |
| --- |
| Web Serial API # extensions-to-the-navigator-interface |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Read from and write to a serial port
* Getting started with the web serial API
Navigator: appVersion property
==============================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

 Returns either "`4.0`" or a string representing version information about
 the browser.

**Note:** Do not rely on this property to return the correct browser version.

Value
-----

 Either "`4.0`" or a string representing version information about the
 browser.

Examples
--------


```js
alert(`Your browser version is reported as ${navigator.appVersion}`);
```

Notes
-----

 The `window.navigator.userAgent` property may also contain the version
 number (for example
 "`Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape 6/6.1`"),
 but you should be aware of how easy it is to change the user agent string and "spoof"
 other browsers, platforms, or user agents, and also how cavalier the browser vendor
 themselves are with these properties.

 The `window.navigator.appVersion`, `window.navigator.appName` and
 `window.navigator.userAgent` properties have been used in "browser sniffing"
 code: scripts that attempt to find out what kind of browser you are using and adjust
 pages accordingly. This lead to the current situation, where browsers had to return fake
 values from these properties in order not to be locked out of some websites.

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-navigator-appversion-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.