diff options
author | JiaJiaJiang <luojia@luojia.me> | 2021-09-20 17:40:37 +0800 |
---|---|---|
committer | Irvin <irvinfly@gmail.com> | 2021-09-28 22:35:26 +0800 |
commit | 42cd8a24a23972f4c378308328503fa2854c7fd0 (patch) | |
tree | 95e210e3f88543e631e1ec3e66d3e5ec8127b5f6 | |
parent | 8949c9132987437a305dfafbf24520a58e884797 (diff) | |
download | translated-content-42cd8a24a23972f4c378308328503fa2854c7fd0.tar.gz translated-content-42cd8a24a23972f4c378308328503fa2854c7fd0.tar.bz2 translated-content-42cd8a24a23972f4c378308328503fa2854c7fd0.zip |
create zh-CN translation for Web/API/Location/ancestorOrigins
-rw-r--r-- | files/zh-cn/web/api/location/ancestororigins/index.md | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/location/ancestororigins/index.md b/files/zh-cn/web/api/location/ancestororigins/index.md new file mode 100644 index 0000000000..244b64c41c --- /dev/null +++ b/files/zh-cn/web/api/location/ancestororigins/index.md @@ -0,0 +1,29 @@ +--- +title: 'Location: ancestorOrigins' +slug: Web/API/Location/ancestorOrigins +tags: + - API + - Location + - Property + - Reference +browser-compat: api.Location.ancestorOrigins +--- +{{APIRef("Location")}} + +{{domxref("Location")}}接口的 **`ancestorOrigins`** 只读属性是一个静态的{{domxref("DOMStringList")}},倒序排列了此{{domxref("Location")}}对象所属文档先前所有浏览上下文的来源。 + +你可以在脚本中使用`location.ancestorOrigins`来检测你的网页是否被你不希望的对象嵌入了。你也可以使用它让网页在被特定站点嵌入时做出不同的表现。 + +## 语法 + +```js +const ancestors = location.ancestorOrigins; +``` + +## 规范 + +{{Specifications}} + +## 浏览器兼容性 + +{{Compat}} |