Table of Contents

Class Fence

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll
NOTE
Experimental
The Fence interface of the {{domxref("Fenced Frame API", "Fenced Frame API", "", "nocode")}} contains several functions relevant to fencedframe functionality.
[Value("Fence")]
public class Fence
Inheritance
Fence
Inherited Members

Remarks

Fence objects are accessed through the Fence property, but they are only available to documents embedded inside {{htmlelement("fencedframe")}}s (loaded via FencedFrameConfigs) or {{htmlelement("iframe")}}s (loaded via opaque URNs).

NOTE

See How do <fencedframe>s work? for some description around FencedFrameConfigs and opaque URNs.

-Fenced frames on privacysandbox.google.com
-The Privacy Sandbox on privacysandbox.google.com

See also on MDN

Constructors

Fence()

public Fence()

Methods

DisableUntrustedNetwork()

[Value("disableUntrustedNetwork")]
public Task<GlobalObject.Undefined> DisableUntrustedNetwork()

Returns

Task<GlobalObject.Undefined>

GetNestedConfigs()

NOTE
Experimental
The getNestedConfigs() method of the
Fence interface returns the FencedFrameConfigs loaded into &lt;fencedframe&gt;s embedded inside the current &lt;fencedframe&gt;.
[Value("getNestedConfigs")]
public List<FencedFrameConfig> GetNestedConfigs()

Returns

List<FencedFrameConfig>

getNestedConfigs() has two possible return values:

Remarks

-Fenced frames on privacysandbox.google.com
-The Privacy Sandbox on privacysandbox.google.com

See also on MDN

NotifyEvent(Event)

[Value("notifyEvent")]
public GlobalObject.Undefined NotifyEvent(Event event_)

Parameters

event_ Event

Returns

GlobalObject.Undefined

ReportEvent(Union38)

NOTE
Experimental
The reportEvent() method of the
Fence interface triggers the submission of report data via a beacon to one or more specific URLs registered via the RegisterAdBeacon(Dictionary<string, string>) method of the Protected Audience API, for the purpose of collecting ad auction results.
[Value("reportEvent")]
public GlobalObject.Undefined ReportEvent(Union38 event_ = default)

Parameters

event_ Union38

Returns

GlobalObject.Undefined

None (Undefined).

Remarks

NOTE

SetReportEventDataForAutomaticBeacons(FenceEvent) provides similar report data submission, except in that case the submission is triggered via a navigation rather than by an explicit method call.

-Fenced frames on privacysandbox.google.com
-The Privacy Sandbox on privacysandbox.google.com

See also on MDN

SetReportEventDataForAutomaticBeacons(FenceEvent)

NOTE
Experimental
The setReportEventDataForAutomaticBeacons() method of the
Fence interface specifies event data that will be sent when a navigation occurs inside a {{htmlelement("fencedframe")}}. This data will be sent via an automatic beacon to one or more specific URLs registered via the RegisterAdBeacon(Dictionary<string, string>) method of the Protected Audience API, for the purpose of collecting reporting data for ad auction results.
[Value("setReportEventDataForAutomaticBeacons")]
public GlobalObject.Undefined SetReportEventDataForAutomaticBeacons(FenceEvent event_ = null)

Parameters

event_ FenceEvent

Returns

GlobalObject.Undefined

None (Undefined).

Remarks

NOTE

ReportEvent(Union38) provides similar report data submission, except in that case the submission is triggered via an explicit method call rather than a navigation.

-Fenced frames on privacysandbox.google.com
-The Privacy Sandbox on privacysandbox.google.com

See also on MDN