Dieser Inhalt wurde automatisch aus dem Englischen übersetzt, und kann Fehler enthalten. Erfahre mehr über dieses Experiment.

View in English Always switch to English

Fence: getNestedConfigs() Methode

Deprecated
To be removed

This feature is pending removal from browsers. Using it now may lead to broken functionality in future updates. Following the announcement that Chrome will maintain its current approach to third-party cookies, Chrome decided to withdraw certain Privacy Sandbox features including the <fencedframe> element and related APIs.

Die getNestedConfigs() Methode des Fence Interfaces gibt die FencedFrameConfigs zurück, die in <fencedframe>s geladen sind, welche innerhalb des aktuellen <fencedframe> eingebettet sind.

Syntax

js
getNestedConfigs()

Parameter

Keine.

Rückgabewert

getNestedConfigs() hat zwei mögliche Rückgabewerte:

  • Ein Array von 20 FencedFrameConfig Objekten, wenn die Konfiguration des aktuellen <fencedframe> mit einer API erstellt wurde, die verschachtelte Konfigurationen unterstützt (beispielsweise Protected Audience). Von diesen 20 Konfigurationen sind die ersten N Konfigurationen jene, die über die API registriert wurden, und der Rest sind Platzhalter-Konfigurationen, die zu about:blank navigieren, sodass die Anzahl der Konfigurationen verborgen bleibt und keine Informationen preisgibt.
  • null wenn die Konfiguration des aktuellen <fencedframe> mit einer API erstellt wurde, die keine verschachtelten Konfigurationen unterstützt (beispielsweise Shared Storage).

Beispiele

js
// Run inside a <fencedframe>

// Retrieve the configs of embedded fenced frames
const configs = window.fence.getNestedConfigs();

// Set a new fenced frame's config to equal one of the retrieved configs
const frame = document.createElement("fencedframe");
frame.config = configs[0];

Spezifikationen

Spezifikation
Fenced Frame
# dom-fence-getnestedconfigs

Browser-Kompatibilität

Siehe auch