recursal/MDN huggingface dataset:
WakeLockSentinel: release event
===============================

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

The **`release`** event of the `WakeLockSentinel` interface is fired when the sentinel object's handle has been released.

 A `WakeLockSentinel` can be released manually via the `release()` method, or automatically via the platform wake lock.
 This can happen if the document becomes inactive or looses visibility, if the device is low on power or the user turns on a power save mode.

Syntax
------

Use the event name in methods like `addEventListener()`, or set an event handler property.


```js
addEventListener("release", (event) => {});

onrelease = (event) => {};
```

Event type
----------

A generic `Event`.

Examples
--------

This example updates the UI if the wake lock is released.


```js
wakeLock.addEventListener("release", () => {
  // if wake lock is released alter the UI accordingly
  statusElement.textContent = "Wake Lock has been released";
});
```

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

| Specification |
| --- |
| Screen Wake Lock API # the-onrelease-attribute |

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

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

See also
--------

* Stay awake with the Screen Wake Lock API
WakeLockSentinel: release() method
==================================

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

The **`release()`** method of the `WakeLockSentinel` interface releases the `WakeLockSentinel`, returning a `Promise` that is resolved once the sentinel has been successfully released.

Syntax
------


```js
release()
```

### Parameters

None.

### Return value

Returns a `Promise` that resolves with `undefined`.

### Exceptions

 No exceptions are thrown.
 You should always listen for the `release` event to check if a wake lock has been released.

Examples
--------

In this example, when a user clicks a button the `WakeLockSentinel` is released.


```js
wakeLockOffButton.addEventListener("click", () => {
  WakeLockSentinel.release();
});
```

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

| Specification |
| --- |
| Screen Wake Lock API # the-release-method |

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

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

See also
--------

* Stay awake with the Screen Wake Lock API
SecurityPolicyViolationEvent: violatedDirective property
========================================================

 The **`violatedDirective`** read-only property of the
 `SecurityPolicyViolationEvent` interface is a string
 representing the directive whose enforcement uncovered the violation.

Value
-----

 A string representing the directive whose enforcement uncovered the
 violation.

Examples
--------


```js
document.addEventListener("securitypolicyviolation", (e) => {
  console.log(e.violatedDirective);
});
```

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

| Specification |
| --- |
| Content Security Policy Level 3 # dom-securitypolicyviolationevent-violateddirective |

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

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

See also
--------

* Content Security Policy (CSP)
SecurityPolicyViolationEvent: columnNumber property
===================================================

 The **`columnNumber`** read-only property of the
 `SecurityPolicyViolationEvent` interface is the column number in the
 document or worker at which the violation occurred.

Value
-----

A number representing the column number where the violation occurred.

Examples
--------


```js
document.addEventListener("securitypolicyviolation", (e) => {
  console.log(e.columnNumber);
});
```

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

| Specification |
| --- |
| Content Security Policy Level 3 # dom-securitypolicyviolationevent-columnnumber |

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

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

See also
--------

* Content Security Policy (CSP)
SecurityPolicyViolationEvent: statusCode property
=================================================

 The **`statusCode`** read-only property of the
 `SecurityPolicyViolationEvent` interface is a number representing the HTTP
 status code of the document or worker in which the violation occurred.

Value
-----

 A number representing the status code of the document or worker in which the violation
 occurred.

Examples
--------


```js
document.addEventListener("securitypolicyviolation", (e) => {
  console.log(e.statusCode);
});
```

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

| Specification |
| --- |
| Content Security Policy Level 3 # dom-securitypolicyviolationevent-statuscode |

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

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

See also
--------

* Content Security Policy (CSP)
SecurityPolicyViolationEvent: lineNumber property
=================================================

 The **`lineNumber`** read-only property of the
 `SecurityPolicyViolationEvent` interface is the line number in the document
 or worker at which the violation occurred.

Value
-----

A number representing the line number at which the violation occurred.

Examples
--------


```js
document.addEventListener("securitypolicyviolation", (e) => {
  console.log(e.lineNumber);
});
```

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

| Specification |
| --- |
| Content Security Policy Level 3 # dom-securitypolicyviolationevent-linenumber |

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

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

See also
--------

* Content Security Policy (CSP)
SecurityPolicyViolationEvent: disposition property
==================================================

 The **`disposition`** read-only property of the
 `SecurityPolicyViolationEvent` interface indicates how the violated policy
 is configured to be treated by the user agent.

Value
-----

 A value defined in the SecurityPolicyViolationEventDisposition enum
 representing the URI of the blocked resource. Possible values are `"enforce"` or `"report"`

Examples
--------


```js
document.addEventListener("securitypolicyviolation", (e) => {
  console.log(e.disposition);
});
```

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

| Specification |
| --- |
| Content Security Policy Level 3 # dom-securitypolicyviolationevent-disposition |

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

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

See also
--------

* Content Security Policy (CSP)
SecurityPolicyViolationEvent: originalPolicy property
=====================================================

 The **`originalPolicy`** read-only property of the
 `SecurityPolicyViolationEvent` interface is a string
 containing the policy whose enforcement uncovered the violation.

Value
-----

 A string representing the policy whose enforcement uncovered the
 violation.

Examples
--------


```js
document.addEventListener("securitypolicyviolation", (e) => {
  console.log(e.originalPolicy);
});
```

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

| Specification |
| --- |
| Content Security Policy Level 3 # dom-securitypolicyviolationevent-originalpolicy |

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

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

See also
--------

* Content Security Policy (CSP)
SecurityPolicyViolationEvent: blockedURI property
=================================================

 The **`blockedURI`** read-only property of the
 `SecurityPolicyViolationEvent` interface is a string
 representing the URI of the resource that was blocked because it violates a policy.

Value
-----

A string representing the URI of the blocked resource.

Examples
--------


```js
document.addEventListener("securitypolicyviolation", (e) => {
  console.log(e.blockedURI);
});
```

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

| Specification |
| --- |
| Content Security Policy Level 3 # dom-securitypolicyviolationevent-blockeduri |

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

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

See also
--------

* Content Security Policy (CSP)
SecurityPolicyViolationEvent: SecurityPolicyViolationEvent() constructor
========================================================================

The **`SecurityPolicyViolationEvent()`** constructor creates a new `SecurityPolicyViolationEvent` object.

Syntax
------


```js
new SecurityPolicyViolationEvent(type)
new SecurityPolicyViolationEvent(type, options)
```

### Parameters

`type`

 A string with the name of the event.
 It is case-sensitive and browsers always set it to `securitypolicyviolation`.


`options` Optional

An object that, *in addition of the properties defined in `Event()`*, can have the following properties:

`blockedURI` Optional

 The `blockedURI` of the `SecurityPolicyViolationEvent`.
 If not included, the default value is `""`.


`columnNumber` Optional

 The `columnNumber` of the `SecurityPolicyViolationEvent`.
 If not included, the default value is `0`.


`disposition`

The `disposition` of the `SecurityPolicyViolationEvent`.

`documentURI`

The `documentURI` of the `SecurityPolicyViolationEvent`.

`effectiveDirective`

The `effectiveDirective` of the `SecurityPolicyViolationEvent`.

`lineNumber` Optional

 The `lineNumber` of the `SecurityPolicyViolationEvent`.
 If not included, the default value is `0`.


`originalPolicy`

The `originalPolicy` of the `SecurityPolicyViolationEvent`.

`referrer` Optional

 The `referrer` of the `SecurityPolicyViolationEvent`.
 If not included, the default value is `""`.


`sample` Optional

 The `sample` of the `SecurityPolicyViolationEvent`.
 If not included, the default value is `""`.


`sourceFile` Optional

 The `sourceFile` of the `SecurityPolicyViolationEvent`.
 If not included, the default value is `""`.


`statusCode`

The `statusCode` of the `SecurityPolicyViolationEvent`.

`violatedDirective`

The `violatedDirective` of the `SecurityPolicyViolationEvent`.


### Return value

A new `SecurityPolicyViolationEvent` object.

Examples
--------


```js
let SPVEvt = new SecurityPolicyViolationEvent("foo", {
  /\* ... \*/
});
```

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

| Specification |
| --- |
| Content Security Policy Level 3 # dom-securitypolicyviolationevent-securitypolicyviolationevent |

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

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

See also
--------

* Content Security Policy (CSP)
SecurityPolicyViolationEvent: referrer property
===============================================

 The **`referrer`** read-only property of the
 `SecurityPolicyViolationEvent` interface is a string
 representing the referrer of the resources whose policy was violated. This will be a URL
 or `null`.

Value
-----

 A string representing the URL of the referrer of the violating
 resources.

Examples
--------


```js
document.addEventListener("securitypolicyviolation", (e) => {
  console.log(e.referrer);
});
```

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

| Specification |
| --- |
| Content Security Policy Level 3 # dom-securitypolicyviolationevent-referrer |

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

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

See also
--------

* Content Security Policy (CSP)
SecurityPolicyViolationEvent: effectiveDirective property
=========================================================

 The **`effectiveDirective`** read-only property of the
 `SecurityPolicyViolationEvent` interface is a string
 representing the directive whose enforcement uncovered the violation.

Value
-----

 A string representing the directive whose enforcement uncovered the
 violation.

Examples
--------


```js
document.addEventListener("securitypolicyviolation", (e) => {
  console.log(e.effectiveDirective);
});
```

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

| Specification |
| --- |
| Content Security Policy Level 3 # dom-securitypolicyviolationevent-effectivedirective |

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

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

See also
--------

* Content Security Policy (CSP)
SecurityPolicyViolationEvent: sourceFile property
=================================================

 The **`sourceFile`** read-only property of the
 `SecurityPolicyViolationEvent` interface is a string
 representing the URI of the document or worker in which the violation was found.

Value
-----

 A string representing the URI of the document or worker in which the
 violation was found.

Examples
--------


```js
document.addEventListener("securitypolicyviolation", (e) => {
  console.log(e.sourceFile);
});
```

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

| Specification |
| --- |
| Content Security Policy Level 3 # dom-securitypolicyviolationevent-sourcefile |

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

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

See also
--------

* Content Security Policy (CSP)
SecurityPolicyViolationEvent: documentURI property
==================================================

 The **`documentURI`** read-only property of the
 `SecurityPolicyViolationEvent` interface is a string
 representing the URI of the document or worker in which the violation was found.

Value
-----

 A string representing the URI of the document or worker in which the
 violation was found.

Examples
--------


```js
document.addEventListener("securitypolicyviolation", (e) => {
  console.log(e.documentURI);
});
```

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

| Specification |
| --- |
| Content Security Policy Level 3 # dom-securitypolicyviolationevent-documenturi |

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

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

See also
--------

* Content Security Policy (CSP)
SecurityPolicyViolationEvent: sample property
=============================================

 The **`sample`** read-only property of the
 `SecurityPolicyViolationEvent` interface is a string
 representing a sample of the resource that caused the violation.

Value
-----

 A string containing a sample of the resource that caused the
 violation, usually the first 40 characters. This will only be populated if the resource
 is an inline script, event handler, or style — external resources causing a violation
 will not generate a sample.

Examples
--------


```js
document.addEventListener("securitypolicyviolation", (e) => {
  console.log(e.sample);
});
```

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

| Specification |
| --- |
| Content Security Policy Level 3 # dom-securitypolicyviolationevent-sample |

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

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

See also
--------

* Content Security Policy (CSP)
IDBIndex: isAutoLocale 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 **`isAutoLocale`** read-only property of the `IDBIndex` interface returns a boolean value indicating whether the index had a `locale` value of `auto` specified upon its creation (see the `options` parameter to `IDBObjectStore.createIndex()`.)

Value
-----

A boolean value.

Examples
--------

In the following example we open a transaction and an object store, then get the index `lName` from a simple contacts database. We then open a basic cursor on the index using `IDBIndex.openCursor` — this works the same as opening a cursor directly on an `ObjectStore` using `IDBObjectStore.openCursor` except that the returned records are sorted based on the index, not the primary key.

The `isAutoLocale` value is logged to the console.


```js
function displayDataByIndex() {
  tableEntry.innerHTML = "";
  const transaction = db.transaction(["contactsList"], "readonly");
  const objectStore = transaction.objectStore("contactsList");

  const myIndex = objectStore.index("lName");
  console.log(myIndex.isAutoLocale);

  myIndex.openCursor().onsuccess = (event) => {
    const cursor = event.target.result;
    if (cursor) {
      const tableRow = document.createElement("tr");
      tableRow.innerHTML =
        `<td>${cursor.value.id}</td>` +
        `<td>${cursor.value.lName}</td>` +
        `<td>${cursor.value.fName}</td>` +
        `<td>${cursor.value.jTitle}</td>` +
        `<td>${cursor.value.company}</td>` +
        `<td>${cursor.value.eMail}</td>` +
        `<td>${cursor.value.phone}</td>` +
        `<td>${cursor.value.age}</td>`;
      tableEntry.appendChild(tableRow);

      cursor.continue();
    } else {
      console.log("Entries all displayed.");
    }
  };
}
```

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

Not currently part of any specification.

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

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

See also
--------

* Using IndexedDB
* Starting transactions: `IDBDatabase`
* Using transactions: `IDBTransaction`
* Setting a range of keys: `IDBKeyRange`
* Retrieving and making changes to your data: `IDBObjectStore`
* Using cursors: `IDBCursor`
* Reference example: To-do Notifications (View the example live).
IDBIndex: locale 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 **`locale`** read-only property of the `IDBIndex` interface returns the locale of the index (for example `en-US`, or `pl`) if it had a `locale` value specified upon its creation (see the `options` parameter to `IDBObjectStore.createIndex()`.) Note that this property always returns the current locale being used in this index, in other words, it never returns `"auto"`.

Value
-----

A string.

Examples
--------

In the following example we open a transaction and an object store, then get the index `lName` from a simple contacts database. We then open a basic cursor on the index using `IDBIndex.openCursor` — this works the same as opening a cursor directly on an `ObjectStore` using `IDBObjectStore.openCursor` except that the returned records are sorted based on the index, not the primary key.

The `locale` value is logged to the console.


```js
function displayDataByIndex() {
  tableEntry.innerHTML = "";
  const transaction = db.transaction(["contactsList"], "readonly");
  const objectStore = transaction.objectStore("contactsList");

  const myIndex = objectStore.index("lName");
  console.log(myIndex.locale);

  myIndex.openCursor().onsuccess = (event) => {
    const cursor = event.target.result;
    if (cursor) {
      const tableRow = document.createElement("tr");
      tableRow.innerHTML =
        `<td>${cursor.value.id}</td>` +
        `<td>${cursor.value.lName}</td>` +
        `<td>${cursor.value.fName}</td>` +
        `<td>${cursor.value.jTitle}</td>` +
        `<td>${cursor.value.company}</td>` +
        `<td>${cursor.value.eMail}</td>` +
        `<td>${cursor.value.phone}</td>` +
        `<td>${cursor.value.age}</td>`;
      tableEntry.appendChild(tableRow);

      cursor.continue();
    } else {
      console.log("Entries all displayed.");
    }
  };
}
```

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

Not currently part of any specification.

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

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

See also
--------

* Using IndexedDB
* Starting transactions: `IDBDatabase`
* Using transactions: `IDBTransaction`
* Setting a range of keys: `IDBKeyRange`
* Retrieving and making changes to your data: `IDBObjectStore`
* Using cursors: `IDBCursor`
* Reference example: To-do Notifications (View the example live).
IDBIndex: multiEntry property
=============================

 The **`multiEntry`** read-only property of the
 `IDBIndex` interface returns a boolean value that affects how the index
 behaves when the result of evaluating the index's key path yields an array.

 This is decided when the index is created, using the
 `IDBObjectStore.createIndex` method. This method takes an optional
 `options` parameter whose `multiEntry` property is set to `true`/`false`.

**Note:** This feature is available in Web Workers

Value
-----

A boolean value:

| Value | Effect |
| --- | --- |
| true | There is one record in the index for each item in an array of keys. |
| false | There is one record for each key that is an array. |

Examples
--------

 In the following example we open a transaction and an object store, then get the
 index `lName` from a simple contacts database. We then open a basic cursor on
 the index using `IDBIndex.openCursor` — this works the same as opening a
 cursor directly on an `ObjectStore` using
 `IDBObjectStore.openCursor` except that the returned records are sorted
 based on the index, not the primary key.

 The multi-entry status of the index is logged to the console: it should be returned
 as `false`.

 Finally, we iterate through each record, and insert the data into an HTML table. For a
 complete working example, see our IndexedDB-examples demo repo (View the example live).


```js
function displayDataByIndex() {
  tableEntry.innerHTML = "";
  const transaction = db.transaction(["contactsList"], "readonly");
  const objectStore = transaction.objectStore("contactsList");

  const myIndex = objectStore.index("lName");
  console.log(myIndex.multiEntry);

  myIndex.openCursor().onsuccess = (event) => {
    const cursor = event.target.result;
    if (cursor) {
      const tableRow = document.createElement("tr");
      tableRow.innerHTML =
        `<td>${cursor.value.id}</td>` +
        `<td>${cursor.value.lName}</td>` +
        `<td>${cursor.value.fName}</td>` +
        `<td>${cursor.value.jTitle}</td>` +
        `<td>${cursor.value.company}</td>` +
        `<td>${cursor.value.eMail}</td>` +
        `<td>${cursor.value.phone}</td>` +
        `<td>${cursor.value.age}</td>`;
      tableEntry.appendChild(tableRow);

      cursor.continue();
    } else {
      console.log("Entries all displayed.");
    }
  };
}
```

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

| Specification |
| --- |
| Indexed Database API 3.0 # dom-idbindex-multientry |

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

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

See also
--------

* Using IndexedDB
* Starting transactions: `IDBDatabase`
* Using transactions: `IDBTransaction`
* Setting a range of keys: `IDBKeyRange`
* Retrieving and making changes to your data: `IDBObjectStore`
* Using cursors: `IDBCursor`
* Reference example: To-do Notifications (View the example live).