Origin Class
An origin (https://html.spec.whatwg.org/multipage/browsers.html#dom-origin-interface), for the same origin and same site comparisons.
public sealed class OriginConstructors
| Name | Description |
|---|---|
| Origin() | Creates a new opaque origin (https://html.spec.whatwg.org/multipage/browsers.html#dom-origin-constructor). |
Origin()
Origin.csCreates a new opaque origin (https://html.spec.whatwg.org/multipage/browsers.html#dom-origin-constructor).
public Origin()Properties
| Name | Description |
|---|---|
| Opaque | Gets whether the origin is opaque (https://html.spec.whatwg.org/multipage/browsers.html#dom-origin-opaque). |
Opaque
Origin.csGets whether the origin is opaque (https://html.spec.whatwg.org/multipage/browsers.html#dom-origin-opaque).
public bool Opaque { get; }Methods
| Name | Description |
|---|---|
| From(object?) | Returns the origin of a value (https://html.spec.whatwg.org/multipage/browsers.html#dom-origin-from): the origin of a platform object that has one (Origin, a same origin-domain Window, a WorkerGlobalScope, a MessageEvent fired by the user agent, Url, the HTML, SVG and MathML a elements and the area element with a URL), or the origin of a URL string. |
| IsSameOrigin(Origin) | Returns whether the origin is same origin with another one (https://html.spec.whatwg.org/multipage/browsers.html#dom-origin-issameorigin). |
| IsSameSite(Origin) | Returns whether the origin is same site with another one (https://html.spec.whatwg.org/multipage/browsers.html#dom-origin-issamesite). |
| ToString() | Returns a string that represents the current object. |
From(object?)
Origin.csReturns the origin of a value (https://html.spec.whatwg.org/multipage/browsers.html#dom-origin-from): the origin of a platform object that has one (Origin, a same origin-domain Window, a WorkerGlobalScope, a MessageEvent fired by the user agent, Url, the HTML, SVG and MathML a elements and the area element with a URL), or the origin of a URL string.
Parameters
valueobject?- The value.
Returns
Exceptions
TypeErrorException- The value has no origin.
See also
IsSameOrigin(Origin)
Origin.csReturns whether the origin is same origin with another one (https://html.spec.whatwg.org/multipage/browsers.html#dom-origin-issameorigin).
IsSameSite(Origin)
Origin.csReturns whether the origin is same site with another one (https://html.spec.whatwg.org/multipage/browsers.html#dom-origin-issamesite).