A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://developer.mozilla.org/de/docs/Web/API/PerformanceNavigationTiming/toJSON below:

PerformanceNavigationTiming: toJSON()-Methode - Web-APIs | MDN

PerformanceNavigationTiming: toJSON()-Methode

Baseline Widely available

Die toJSON()-Methode der PerformanceNavigationTiming-Schnittstelle ist ein Serialisierer; sie gibt eine JSON-Repräsentation des PerformanceNavigationTiming-Objekts zurück.

Syntax Parameter

Keine.

Rückgabewert

Ein JSON-Objekt, das die Serialisierung des PerformanceNavigationTiming-Objekts ist.

Beispiele Verwendung der toJSON-Methode

In diesem Beispiel liefert der Aufruf von entry.toJSON() eine JSON-Repräsentation des PerformanceNavigationTiming-Objekts.

const observer = new PerformanceObserver((list) => {
  list.getEntries().forEach((entry) => {
    console.log(entry.toJSON());
  });
});

observer.observe({ entryTypes: ["navigation"] });

Dies würde ein JSON-Objekt wie folgt protokollieren:

{
  "name": "https://en.wikipedia.org/wiki/Main_Page",
  "entryType": "navigation",
  "startTime": 0,
  "duration": 227.60000002384186,
  "initiatorType": "navigation",
  "nextHopProtocol": "h2",
  "renderBlockingStatus": "blocking",
  "workerStart": 0,
  "redirectStart": 4,
  "redirectEnd": 71.40000000596046,
  "fetchStart": 71.40000000596046,
  "domainLookupStart": 71.40000000596046,
  "domainLookupEnd": 71.40000000596046,
  "connectStart": 71.40000000596046,
  "connectEnd": 71.40000000596046,
  "secureConnectionStart": 71.40000000596046,
  "requestStart": 73.7000000178814,
  "responseStart": 102.90000000596046,
  "responseEnd": 105.2000000178814,
  "transferSize": 19464,
  "encodedBodySize": 19164,
  "decodedBodySize": 83352,
  "serverTiming": [
    {
      "name": "cache",
      "duration": 0,
      "description": "hit-front"
    },
    {
      "name": "host",
      "duration": 0,
      "description": "cp3062"
    }
  ],
  "unloadEventStart": 0,
  "unloadEventEnd": 0,
  "domInteractive": 178.10000002384186,
  "domContentLoadedEventStart": 178.2000000178814,
  "domContentLoadedEventEnd": 178.2000000178814,
  "domComplete": 227.60000002384186,
  "loadEventStart": 227.60000002384186,
  "loadEventEnd": 227.60000002384186,
  "type": "navigate",
  "redirectCount": 1,
  "activationStart": 0
}

Um einen JSON-String zu erhalten, können Sie direkt JSON.stringify(entry) verwenden; es wird toJSON() automatisch aufrufen.

Spezifikationen Browser-Kompatibilität Siehe auch

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4