Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add toJSON() to PerformanceTiming and PerformanceNavigation #24126

Merged
merged 5 commits into from
Feb 3, 2023
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
6 changes: 3 additions & 3 deletions files/en-us/web/api/performancenavigation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ _The `PerformanceNavigation` interface doesn't inherit any properties._

_The `Performance` interface doesn't inherit any methods._

- {{deprecated_inline}} {{domxref("PerformanceNavigation.toJSON()")}}
- : A jsonizer returning a JSON object representing the `PerformanceNavigation` object.
- {{domxref("PerformanceNavigation.toJSON()")}} {{deprecated_inline}}
- : A {{Glossary("Serialization","serializer")}} returning a JSON object representing the `PerformanceNavigation` object.

## Specifications

Expand All @@ -65,4 +65,4 @@ Use the {{domxref("PerformanceNavigationTiming")}} interface instead.
## See also

- The {{domxref("Performance")}} that allows access to an object of this type.
- {{domxref("PerformanceNavigationTiming")}} (part of Navigation Timing Level 2) {{experimental_inline}}
- {{domxref("PerformanceNavigationTiming")}} (part of Navigation Timing Level 2) that has superseded this API.
45 changes: 45 additions & 0 deletions files/en-us/web/api/performancenavigation/tojson/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: PerformanceNavigation.toJSON()
slug: Web/API/PerformanceNavigation/toJSON
page-type: web-api-instance-method
tags:
- API
- Method
- Reference
- Web Performance
teoli2003 marked this conversation as resolved.
Show resolved Hide resolved
- Deprecated
browser-compat: api.PerformanceNavigation.toJSON
---

{{APIRef("Performance API")}} {{deprecated_header}}

> **Warning:** This interface of this property is deprecated in the [Navigation Timing Level 2 specification](https://w3c.github.io/navigation-timing/#obsolete). Please use the {{domxref("PerformanceNavigationTiming")}}
> interface instead.

The **`toJSON()`** method of the {{domxref("PerformanceNavigation")}} interface is a {{Glossary("Serialization","serializer")}}; it returns a JSON representation of the {{domxref("PerformanceNavigation")}} object.

## Syntax

```js-nolint
toJSON()
```

### Parameters

None.

### Return value

A {{jsxref("JSON")}} object that is the serialization of the {{domxref("PerformanceNavigation")}} object.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{jsxref("JSON")}}
3 changes: 2 additions & 1 deletion files/en-us/web/api/performancetiming/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ These properties are listed in the order in which they occur during the navigati

_The `PerformanceTiming`_ _interface doesn't inherit any methods._

- {{Deprecated_Inline}} {{domxref("PerformanceTiming.toJSON()")}}
- {{domxref("PerformanceTiming.toJSON()")}} {{Deprecated_Inline}}
- : Returns a [JSON object](/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON) representing this `PerformanceTiming` object.

## Specifications
Expand All @@ -95,3 +95,4 @@ Use the {{domxref("PerformanceNavigationTiming")}} interface instead.
## See also

- The {{domxref("Performance.timing")}} property that creates such an object.
- {{domxref("PerformanceNavigationTiming")}} (part of Navigation Timing Level 2) that has superseded this API.
45 changes: 45 additions & 0 deletions files/en-us/web/api/performancetiming/tojson/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: PerformanceTiming.toJSON()
slug: Web/API/PerformanceTiming/toJSON
page-type: web-api-instance-method
tags:
- API
- Method
- Reference
- Web Performance
- Deprecated
browser-compat: api.PerformanceTiming.toJSON
---

{{APIRef("Performance API")}}{{deprecated_header}}

> **Warning:** This interface of this property is deprecated in the [Navigation Timing Level 2 specification](https://w3c.github.io/navigation-timing/#obsolete). Please use the {{domxref("PerformanceNavigationTiming")}}
> interface instead.

The legacy **`toJSON()`** method of the {{domxref("PerformanceTiming")}} interface is a {{Glossary("Serialization","serializer")}}; it returns a JSON representation of the {{domxref("PerformanceTiming")}} object.

## Syntax

```js-nolint
toJSON()
```

### Parameters

None.

### Return value

A {{jsxref("JSON")}} object that is the serialization of the {{domxref("PerformanceTiming")}} object.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{jsxref("JSON")}}