Skip to content

Commit

Permalink
[zh-cn]: add translation for `{Navigator,WorkerNavigator}.userAgentDa…
Browse files Browse the repository at this point in the history
…ta` (#19198)

Co-authored-by: A1lo <[email protected]>
  • Loading branch information
skyclouds2001 and yin1999 authored Apr 4, 2024
1 parent d5f2466 commit 1a35d70
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
34 changes: 34 additions & 0 deletions files/zh-cn/web/api/navigator/useragentdata/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: Navigator:userAgentData 属性
slug: Web/API/Navigator/userAgentData
l10n:
sourceCommit: 8ccdd482e4723b5393278bba686adc24d1769d0f
---

{{securecontext_header}}{{APIRef("User-Agent Client Hints API")}}{{SeeCompatTable}}

{{domxref("Navigator")}} 接口的 **`userAgentData`** 只读属性返回一个 {{domxref("NavigatorUAData")}} 对象,其可用于访问{{domxref("User-Agent Client Hints API", "用户代理客户端提示 API", "", "nocode")}}。

##

一个 {{domxref("NavigatorUAData")}} 对象。

## 示例

以下示例将 {{domxref("NavigatorUAData.brands")}} 的值打印到控制台。

```js
console.log(navigator.userAgentData.brands);
```

## 规范

{{Specifications}}

## 浏览器兼容性

{{Compat}}

## 参见

- [利用用户代理客户端提示改善用户隐私并提升开发者体验](https://developer.chrome.com/docs/privacy-security/user-agent-client-hints)
34 changes: 34 additions & 0 deletions files/zh-cn/web/api/workernavigator/useragentdata/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: WorkerNavigator:userAgentData 属性
slug: Web/API/WorkerNavigator/userAgentData
l10n:
sourceCommit: 8ccdd482e4723b5393278bba686adc24d1769d0f
---

{{APIRef("User-Agent Client Hints API")}}{{SeeCompatTable}}{{securecontext_header}}

{{domxref("WorkerNavigator")}} 接口的 **`userAgentData`** 只读属性返回一个 {{domxref("NavigatorUAData")}} 对象,其可用于访问{{domxref("User-Agent Client Hints API", "用户代理客户端提示 API", "", "nocode")}}。

##

一个 {{domxref("NavigatorUAData")}} 对象。

## 示例

以下示例将 {{domxref("NavigatorUAData.brands")}} 的值打印到控制台。

```js
console.log(navigator.userAgentData.brands);
```

## 规范

{{Specifications}}

## 浏览器兼容性

{{Compat}}

## 参见

- [利用用户代理客户端提示改善用户隐私并提升开发者体验](https://developer.chrome.com/docs/privacy-security/user-agent-client-hints)

0 comments on commit 1a35d70

Please sign in to comment.