Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions files/en-us/mozilla/firefox/experimental_features/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -457,29 +457,6 @@ See [Firefox bug 1602129](https://bugzil.la/1602129) for our progress on this AP
- `dom.webgpu.service-workers.enabled`
- : Set to `true` to enable (enabled in Nightly)

### Reporting API support for CSP Violations

The [Reporting API](/en-US/docs/Web/API/Reporting_API) now has support for reporting [Content Security Policy (CSP)](/en-US/docs/Web/HTTP/Guides/CSP) violations.

{{domxref('Report')}} instances returned by the {{domxref('ReportingObserver')}} interface can now have a `type` value of `"csp-violation"` and a `body` property that contains an instance of the {{domxref('CSPViolationReportBody')}} interface.
This allows CSP violations to be reported within a web page.

CSP violation reports can also be sent to remote endpoints that are specified by name in the CSP {{CSP("report-to")}} directive — endpoints names and corresponding URLs must first be defined in the {{httpheader('Reporting-Endpoints')}} or {{httpheader('Report-To')}} HTTP response headers.
The report is a serialization of the {{domxref('Report')}} object described above, with a `body` property that is a serialization of a {{domxref('CSPViolationReportBody')}} instance.

This violation report replaces a similar CSP-specific mechanism for sending violation reports, which uses the CSP {{CSP("report-uri")}} directive to set the URL of the reporting endpoint, and has a [CSP-specific JSON violation report format](/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/report-uri#violation_report_syntax).
([Firefox bug 1391243](https://bugzil.la/1391243)).

| Release channel | Version added | Enabled by default? |
| ----------------- | ------------- | ------------------- |
| Nightly | 130 | No |
| Developer Edition | 130 | No |
| Beta | 130 | No |
| Release | 130 | No |

- `dom.reporting.enabled`
- : Set to `true` to enable.

### WebRTC and media

The following experimental features include those found in media APIs such as the [WebRTC API](/en-US/docs/Web/API/WebRTC_API), the [Web Audio API](/en-US/docs/Web/API/Web_Audio_API), the [Media Source Extensions API](/en-US/docs/Web/API/Media_Source_Extensions_API), the [Encrypted Media Extensions API](/en-US/docs/Web/API/Encrypted_Media_Extensions_API), and the [Media Capture and Streams API](/en-US/docs/Web/API/Media_Capture_and_Streams_API).
Expand Down
5 changes: 5 additions & 0 deletions files/en-us/mozilla/firefox/releases/149/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ Firefox 149 is the current [Beta version of Firefox](https://www.firefox.com/en-
In addition, the methods now allow both resize options ([`options.resizeWidth`](/en-US/docs/Web/API/Window/createImageBitmap#resizewidth) or [`options.resizeHeight`](/en-US/docs/Web/API/Window/createImageBitmap#resizeheight)) and image bitmap parameters ([`sx`, `sy`, `sw`, and `sh`](/en-US/docs/Web/API/Window/createImageBitmap#sx)) to be set at the same time — previously setting both returned the unscaled source bitmap.
([Firefox bug 2010125](https://bugzil.la/2010125)).

- The [Reporting API](/en-US/docs/Web/API/Reporting_API) is now supported for reporting [Content Security Policy (CSP)](/en-US/docs/Web/HTTP/Guides/CSP) and {{httpheader("Integrity-Policy")}} violations.
This allows report objects that are {{domxref("CSPViolationReport")}} objects and {{domxref("IntegrityViolationReport")}} objects to be reported in violating pages using a {{domxref("ReportingObserver")}} (reports can be filtered on the `type` property: `"csp-violation"` or `"integrity-violation"`).
A serialized version of the report objects can also be sent to a reporting server specified in the corresponding HTTP header — endpoint names and corresponding URLs must first be defined in the {{httpheader('Reporting-Endpoints')}} or {{httpheader('Report-To')}} HTTP response headers.
([Firefox bug 1976074](https://bugzil.la/1976074), [Firefox bug 2008916](https://bugzil.la/2008916)).

#### DOM

- The [`HTMLSelectElement.showPicker()`](/en-US/docs/Web/API/HTMLInputElement/showPicker#showpicker_for_a_datalist_input) method is now supported for a list of options defined in a {{htmlelement("datalist")}}.
Expand Down
4 changes: 3 additions & 1 deletion files/en-us/web/api/bufferedchangeevent/addedranges/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ title: "BufferedChangeEvent: addedRanges property"
short-title: addedRanges
slug: Web/API/BufferedChangeEvent/addedRanges
page-type: web-api-instance-property
status:
- experimental
browser-compat: api.BufferedChangeEvent.addedRanges
---

{{APIRef("Media Source Extensions")}}{{AvailableInWorkers("window_and_dedicated")}}
{{APIRef("Media Source Extensions")}}{{AvailableInWorkers("window_and_dedicated")}}{{SeeCompatTable}}

The **`addedRanges`** read-only property of the {{domxref("BufferedChangeEvent")}} interface returns a {{domxref("TimeRanges")}} object representing the time ranges that were added to the associated {{domxref("ManagedSourceBuffer")}}. These are the ranges added between the last `updatestart` and `updateend` events, during the most recent run of the coded frame processing algorithm.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ title: "BufferedChangeEvent: BufferedChangeEvent() constructor"
short-title: BufferedChangeEvent()
slug: Web/API/BufferedChangeEvent/BufferedChangeEvent
page-type: web-api-constructor
status:
- experimental
browser-compat: api.BufferedChangeEvent.BufferedChangeEvent
---

{{APIRef("Media Source Extensions")}}{{AvailableInWorkers("window_and_dedicated")}}
{{APIRef("Media Source Extensions")}}{{AvailableInWorkers("window_and_dedicated")}}{{SeeCompatTable}}

The **`BufferedChangeEvent()`** constructor of the {{domxref("BufferedChangeEvent")}} interface creates a new `BufferedChangeEvent` object instance.

Expand Down
10 changes: 6 additions & 4 deletions files/en-us/web/api/bufferedchangeevent/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,29 @@
title: BufferedChangeEvent
slug: Web/API/BufferedChangeEvent
page-type: web-api-interface
status:
- experimental
browser-compat: api.BufferedChangeEvent
---

{{APIRef("Media Source Extensions")}}{{AvailableInWorkers("window_and_dedicated")}}
{{APIRef("Media Source Extensions")}}{{AvailableInWorkers("window_and_dedicated")}}{{SeeCompatTable}}

The **`BufferedChangeEvent`** interface of the {{domxref("Media Source Extensions API", "Media Source Extensions API", "", "nocode")}} represents the event object for the {{domxref("ManagedSourceBuffer.bufferedchange_event", "bufferedchange")}} event fired on a {{domxref("ManagedSourceBuffer")}}. This event is fired whenever the buffered ranges of the `ManagedSourceBuffer` change, for example as a result of {{domxref("SourceBuffer.appendBuffer", "appendBuffer()")}}, {{domxref("SourceBuffer.remove", "remove()")}}, or {{domxref("MediaSource.endOfStream", "endOfStream()")}} calls, or when the user agent runs the memory cleanup algorithm.

{{InheritanceDiagram}}

## Constructor

- {{domxref("BufferedChangeEvent.BufferedChangeEvent", "BufferedChangeEvent()")}}
- {{domxref("BufferedChangeEvent.BufferedChangeEvent", "BufferedChangeEvent()")}} {{experimental_inline}}
- : Creates and returns a new `BufferedChangeEvent` object.

## Instance properties

_Also inherits properties from its parent interface, {{domxref("Event")}}._

- {{domxref("BufferedChangeEvent.addedRanges")}} {{ReadOnlyInline}}
- {{domxref("BufferedChangeEvent.addedRanges")}} {{ReadOnlyInline}} {{experimental_inline}}
- : A {{domxref("TimeRanges")}} object representing the time ranges that were added to the {{domxref("ManagedSourceBuffer")}}'s buffer.
- {{domxref("BufferedChangeEvent.removedRanges")}} {{ReadOnlyInline}}
- {{domxref("BufferedChangeEvent.removedRanges")}} {{ReadOnlyInline}} {{experimental_inline}}
- : A {{domxref("TimeRanges")}} object representing the time ranges that were removed from the {{domxref("ManagedSourceBuffer")}}'s buffer.

## Examples
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ title: "BufferedChangeEvent: removedRanges property"
short-title: removedRanges
slug: Web/API/BufferedChangeEvent/removedRanges
page-type: web-api-instance-property
status:
- experimental
browser-compat: api.BufferedChangeEvent.removedRanges
---

{{APIRef("Media Source Extensions")}}{{AvailableInWorkers("window_and_dedicated")}}
{{APIRef("Media Source Extensions")}}{{AvailableInWorkers("window_and_dedicated")}}{{SeeCompatTable}}

The **`removedRanges`** read-only property of the {{domxref("BufferedChangeEvent")}} interface returns a {{domxref("TimeRanges")}} object representing the time ranges that were removed from the associated {{domxref("ManagedSourceBuffer")}}. These are the ranges removed between the last `updatestart` and `updateend` events, during the most recent run of the coded frame removal or coded frame eviction algorithm, or as a consequence of the user agent running the memory cleanup algorithm.

Expand Down
4 changes: 1 addition & 3 deletions files/en-us/web/api/deprecationreport/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
title: DeprecationReport
slug: Web/API/DeprecationReport
page-type: web-api-interface
status:
- experimental
browser-compat: api.ReportingObserver.ReportingObserver.options_parameter.types_property.deprecation
---

{{APIRef("Reporting API")}}{{SeeCompatTable}}
{{APIRef("Reporting API")}}

The `DeprecationReport` dictionary of the [Reporting API](/en-US/docs/Web/API/Reporting_API) represents a deprecation report.

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/document/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ _This interface also inherits from the {{DOMxRef("Node")}} and {{DOMxRef("EventT
- : Replaces the existing children of a document with a specified new set of children.
- {{DOMxRef("Document.requestStorageAccess()")}}
- : Allows a document loaded in a third-party context (i.e., embedded in an {{htmlelement("iframe")}}) to request access to unpartitioned cookies, in cases where user agents by default block access to unpartitioned cookies by sites loaded in a third-party context to improve privacy.
- {{DOMxRef("Document.requestStorageAccessFor()")}} {{experimental_inline}}
- {{DOMxRef("Document.requestStorageAccessFor()")}} {{deprecated_inline}}
- : Allows top-level sites to request third-party cookie access on behalf of embedded content originating from another site in the same [related website set](/en-US/docs/Web/API/Storage_Access_API/Related_website_sets).
- {{domxref("Document.startViewTransition()")}}
- : Starts a new {{domxref("View Transition API", "view transition", "", "nocode")}} and returns a {{domxref("ViewTransition")}} object to represent it.
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/document/requeststorageaccessfor/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ short-title: requestStorageAccessFor()
slug: Web/API/Document/requestStorageAccessFor
page-type: web-api-instance-method
status:
- experimental
- deprecated
browser-compat: api.Document.requestStorageAccessFor
---

{{APIRef("Storage Access API")}}{{SeeCompatTable}}
{{APIRef("Storage Access API")}}{{deprecated_header}}

The **`requestStorageAccessFor()`** method of the {{domxref("Document")}} interface allows top-level sites to request third-party cookie access on behalf of embedded content originating from another site in the same [related website set](/en-US/docs/Web/API/Storage_Access_API/Related_website_sets). It returns a {{jsxref("Promise")}} that resolves if the access was granted, and rejects if access was denied.

Expand Down
53 changes: 53 additions & 0 deletions files/en-us/web/api/htmlanchorelement/attributionsourceid/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: "HTMLAnchorElement: attributionSourceId property"
short-title: attributionSourceId
slug: Web/API/HTMLAnchorElement/attributionSourceId
page-type: web-api-instance-property
status:
- experimental
browser-compat: api.HTMLAnchorElement.attributionSourceId
---

{{APIRef("HTML DOM")}}{{SeeCompatTable}}

The **`attributionSourceId`** property of the {{domxref("HTMLAnchorElement")}} interface gets and sets the `attributionsourceid` HTML attribute on an {{htmlelement("a")}} element.

The `attributionSourceId` is used as part of the [Private Click Measurement](https://privacycg.github.io/private-click-measurement/) specification to identify the content that was clicked when following a link to another site.

## Value

A number. Valid values for private click measurement are between `0` and `255`. The default value is `0`. Values outside this range will not cause an error when setting the property, but will be ignored by the browser for attribution purposes.

## Examples

### Setting an attribution source ID on a link

```html
<a
id="ad-link"
href="https://example.com"
attributiondestination="https://example.com">
Click to visit our shop
</a>
```

```js
const adLink = document.getElementById("ad-link");
adLink.attributionSourceId = 17;

console.log(adLink.attributionSourceId); // 17
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("HTMLAnchorElement")}}
- {{htmlelement("a")}} HTML element
- [Private Click Measurement](https://privacycg.github.io/private-click-measurement/) specification
2 changes: 2 additions & 0 deletions files/en-us/web/api/htmlanchorelement/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ The **`HTMLAnchorElement`** interface represents hyperlink elements and provides

_Inherits properties from its parent, {{domxref("HTMLElement")}}._

- {{domxref("HTMLAnchorElement.attributionSourceId")}} {{experimental_inline}}
- : A non-negative integer representing the attribution source identifier used for [Private Click Measurement](https://privacycg.github.io/private-click-measurement/). Valid values are from `0` to `255`.
- {{domxref("HTMLAnchorElement.attributionSrc")}} {{securecontext_inline}} {{deprecated_inline}}
- : Gets and sets the [`attributionsrc`](/en-US/docs/Web/HTML/Reference/Elements/a#attributionsrc) attribute on an {{htmlelement("a")}} element programmatically, reflecting the value of that attribute. `attributionsrc` specifies that you want the browser to send an {{httpheader("Attribution-Reporting-Eligible")}} header. On the server-side this is used to trigger sending an {{httpheader("Attribution-Reporting-Register-Source")}} header in the response, to register a navigation-based attribution source.
- {{domxref("HTMLAnchorElement.download")}}
Expand Down
91 changes: 91 additions & 0 deletions files/en-us/web/api/htmlmediaelement/getstartdate/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
title: "HTMLMediaElement: getStartDate() method"
short-title: getStartDate()
slug: Web/API/HTMLMediaElement/getStartDate
page-type: web-api-instance-method
browser-compat: api.HTMLMediaElement.getStartDate
---

{{APIRef("HTML DOM")}}

The **`getStartDate()`** method of the {{domxref("HTMLMediaElement")}} interface returns a new {{jsxref("Date")}} object representing the real-world date and time corresponding to the beginning of the media.

This is useful for media streams that are anchored to a real-world clock, such as a live broadcast that began at a specific date and time. For media that does not include date and time information, the returned `Date` object will have a time value of {{jsxref("NaN")}}.

## Syntax

```js-nolint
getStartDate()
```

### Parameters

None.

### Return value

A {{jsxref("Date")}} object representing the start date and time of the media. If the media does not include date and time information, the returned `Date` object will have a time value of `NaN`.

## Description

Internally, each media element tracks a start date, which begins as `NaN` (not set). Once the browser has loaded enough data to read the media's metadata, it sets the start date to the real-world time that corresponds to the beginning of the media — if the format provides one. If it doesn't, the start date stays `NaN`.

For media that does specify a start time and date (for example, a live TV broadcast streamed over the web), `getStartDate()` returns a `Date` object corresponding to the real-world time at which the media begins. This allows media player controls to display absolute times (such as "2:30 PM") rather than times relative to the start of playback (such as "3 hours, 12 minutes").

The returned `Date` will have a time value of `NaN` (making it an [invalid date](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date)) in either of the following cases:

- No data has been loaded yet ({{domxref("HTMLMediaElement.readyState", "readyState")}} is `HAVE_NOTHING`), so the start date hasn't been set.
- The media format doesn't include date and time information.

The start date is not guaranteed to be available as soon as the {{domxref("HTMLMediaElement/loadedmetadata_event", "loadedmetadata")}} event fires. For example, [HLS](https://developer.apple.com/documentation/http-live-streaming) streams carry dates in segment-level `#EXT-X-PROGRAM-DATE-TIME` tags, which may not have been read yet at that point. Listening for the {{domxref("HTMLMediaElement/loadeddata_event", "loadeddata")}} event instead is more reliable across formats, because by then the browser has loaded enough data to determine the start date.

## Examples

### Displaying the start date of a live stream

This example retrieves the start date of a live stream — the real-world date and time at which the broadcast began, as embedded in the stream by the server — and displays it. It listens for the {{domxref("HTMLMediaElement/loadeddata_event", "loadeddata")}} event, which fires once enough data has been loaded for the start date to be available.

#### HTML

```html
<video src="livestream.m3u8" controls></video>
<output>Start date: loading…</output>
```

#### JavaScript

```js
const video = document.querySelector("video");
const display = document.querySelector("output");

video.addEventListener("loadeddata", () => {
const startDate = video.getStartDate();

if (isNaN(startDate.getTime())) {
display.textContent = "Start date: not available";
} else {
display.textContent = `Start date: ${startDate.toLocaleString()}`;
}
});
```

#### Result

The output below shows the start date of the media, as provided by the server.
Note that this is encoded in the example metadata in [stream.m3u8](https://github.com/mdn/dom-examples/blob/main/media/getstartdate/stream.m3u8).

{{EmbedGHLiveSample("dom-examples/media/getstartdate/", '100%', 400)}}

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("HTMLMediaElement")}}
- {{domxref("HTMLMediaElement.currentTime")}}
- {{domxref("HTMLMediaElement.duration")}}
2 changes: 2 additions & 0 deletions files/en-us/web/api/htmlmediaelement/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ _This interface also inherits methods from its ancestors {{domxref("HTMLElement"
- : Given a string specifying a MIME media type (potentially with the [`codecs` parameter](/en-US/docs/Web/Media/Guides/Formats/codecs_parameter) included), `canPlayType()` returns the string `probably` if the media should be playable, `maybe` if there's not enough information to determine whether the media will play or not, or an empty string if the media cannot be played.
- {{domxref("HTMLMediaElement.fastSeek()")}}
- : Quickly seeks to the given time with low precision.
- {{domxref("HTMLMediaElement.getStartDate()")}}
- : Returns a {{jsxref("Date")}} object representing the real-world date and time corresponding to the beginning of the media. For live streams, this is the time the broadcast began on the server, which may be before the user started watching.
- {{domxref("HTMLMediaElement.load()")}}
- : Resets the media to the beginning and selects the best available source from the sources provided using the [`src`](/en-US/docs/Web/HTML/Reference/Elements/video#src) attribute or the {{HTMLElement("source")}} element.
- {{domxref("HTMLMediaElement.pause()")}}
Expand Down
Loading