ancestorOrigins 只读特性在 定位 interface is a static DOMStringList containing, in reverse order, the origins of all ancestor browsing contexts of the document associated with the given 定位 对象。

可以使用 location.ancestorOrigins in the script for a document to determine, for example, whenever the document is being framed by a site which you don’t expect it to be framed by. You can also use it to vary the behavior of the document based on what site or list of sites is framing it.

句法

const ancestors = location.ancestorOrigins;
					

规范

规范 状态 注释
HTML 实时标准
The definition of 'ancestorOrigins ' in that specification.
实时标准

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
ancestorOrigins Chrome 20 Edge 79 Firefox No IE No Opera 15 Safari 6 WebView Android 4.4 Chrome Android 25 Firefox Android No Opera Android 14 Safari iOS 6 Samsung Internet Android 1.5

图例

完整支持

完整支持

不支持

不支持

元数据

  • 最后修改: