WindowClient: ancestorOrigins property
Service Workers APIservice
Service Workers APIservice
The **`ancestorOrigins`** read-only property of the WindowClient interface is an array of strings listing the origins of all ancestors of the browsing context represented by this `WindowClient` in reverse order.
The first element in the array is the origin of this window's parent, and the last element is the origin of the top-level browsing context. If this window is itself a top-level browsing context, then `ancestorOrigins` is an empty array.
> [!NOTE]
> The [`referrerpolicy`](/docs/Web/HTML/Reference/Elements/iframe#referrerpolicy) attribute of an embedding `<iframe>` affects this list. Setting `referrerpolicy` to `no-referrer`, or to `same-origin` when the framed document is cross-origin, redacts the origin of the document containing the `<iframe>` from the `ancestorOrigins` list of the framed document. The origin is replaced with an opaque origin, which serializes as `"null"`.
## Value
An array of strings.
## Specifications
## Browser compatibility
Cite this
"WindowClient: ancestorOrigins property". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/WindowClient/ancestorOrigins JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy