From a3af8626db3e19b9339c655c48389be7c9e84787 Mon Sep 17 00:00:00 2001 From: hoarfroster Date: Fri, 13 Sep 2024 21:19:37 +0800 Subject: [PATCH 1/3] feat: update translation --- .../api/extension/inincognitocontext/index.md | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 files/zh-cn/mozilla/add-ons/webextensions/api/extension/inincognitocontext/index.md diff --git a/files/zh-cn/mozilla/add-ons/webextensions/api/extension/inincognitocontext/index.md b/files/zh-cn/mozilla/add-ons/webextensions/api/extension/inincognitocontext/index.md new file mode 100644 index 00000000000000..39dfd133dbaa64 --- /dev/null +++ b/files/zh-cn/mozilla/add-ons/webextensions/api/extension/inincognitocontext/index.md @@ -0,0 +1,59 @@ +--- +title: extension.inIncognitoContext +slug: Mozilla/Add-ons/WebExtensions/API/extension/inIncognitoContext +l10n: + sourceCommit: a16fecbf75f71fc11e03ef6cd0b0c34ad6f3d480 +--- + +{{AddonSidebar}} + +布尔值,`true` 表示内容脚本在隐私浏览标签页中运行,并且扩展页面在隐私浏览进程中运行。 + +## 语法 + +```js-nolint +let isPrivate = browser.extension.inIncognitoContext; // true 或 false +``` + +### Value + +指示当前脚本是否在隐私标签页或进程中运行的*布尔*值。 + +## 浏览器兼容性 + +{{Compat}} + +{{WebExtExamples}} + +> [!NOTE] +> 此 API 基于 Chromium 的 [`chrome.extension`](https://developer.chrome.com/docs/extensions/reference/extension/#property-inIncognitoContext) API。该文档衍生自 Chromium 代码中的 [`extension.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/extension.json)。 + + From cf2bab2c2e9f1b64f8d569a518c440c5ed8272e3 Mon Sep 17 00:00:00 2001 From: Hoarfroster Date: Fri, 13 Sep 2024 21:42:52 +0800 Subject: [PATCH 2/3] fix: typo --- .../webextensions/api/extension/inincognitocontext/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/zh-cn/mozilla/add-ons/webextensions/api/extension/inincognitocontext/index.md b/files/zh-cn/mozilla/add-ons/webextensions/api/extension/inincognitocontext/index.md index 39dfd133dbaa64..37f21b1ee0f0ed 100644 --- a/files/zh-cn/mozilla/add-ons/webextensions/api/extension/inincognitocontext/index.md +++ b/files/zh-cn/mozilla/add-ons/webextensions/api/extension/inincognitocontext/index.md @@ -2,7 +2,7 @@ title: extension.inIncognitoContext slug: Mozilla/Add-ons/WebExtensions/API/extension/inIncognitoContext l10n: - sourceCommit: a16fecbf75f71fc11e03ef6cd0b0c34ad6f3d480 + sourceCommit: a16fecbf75f71fc11e03ef6cd0b0c34ad6f3d480 --- {{AddonSidebar}} @@ -15,7 +15,7 @@ l10n: let isPrivate = browser.extension.inIncognitoContext; // true 或 false ``` -### Value +### 取值 指示当前脚本是否在隐私标签页或进程中运行的*布尔*值。 From 76e5fe1cf31084e3b467f6ffa6a5b46e54978dd7 Mon Sep 17 00:00:00 2001 From: Hoarfroster Date: Fri, 20 Sep 2024 20:22:22 +0800 Subject: [PATCH 3/3] feat: improvements --- .../api/extension/inincognitocontext/index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/files/zh-cn/mozilla/add-ons/webextensions/api/extension/inincognitocontext/index.md b/files/zh-cn/mozilla/add-ons/webextensions/api/extension/inincognitocontext/index.md index 37f21b1ee0f0ed..6f61dfee2cb212 100644 --- a/files/zh-cn/mozilla/add-ons/webextensions/api/extension/inincognitocontext/index.md +++ b/files/zh-cn/mozilla/add-ons/webextensions/api/extension/inincognitocontext/index.md @@ -2,12 +2,12 @@ title: extension.inIncognitoContext slug: Mozilla/Add-ons/WebExtensions/API/extension/inIncognitoContext l10n: - sourceCommit: a16fecbf75f71fc11e03ef6cd0b0c34ad6f3d480 + sourceCommit: b8a0743ca8b1e1b1b1a95cc93a4413c020f11262 --- {{AddonSidebar}} -布尔值,`true` 表示内容脚本在隐私浏览标签页中运行,并且扩展页面在隐私浏览进程中运行。 +布尔值,其中 `true` 表示内容脚本在隐私浏览标签页中运行,并且扩展页面在隐私浏览进程中运行。 ## 语法 @@ -17,7 +17,7 @@ let isPrivate = browser.extension.inIncognitoContext; // true 或 false ### 取值 -指示当前脚本是否在隐私标签页或进程中运行的*布尔*值。 +指示当前脚本是否在隐私标签页或进程中运行的*布尔值*。 ## 浏览器兼容性 @@ -26,7 +26,7 @@ let isPrivate = browser.extension.inIncognitoContext; // true 或 false {{WebExtExamples}} > [!NOTE] -> 此 API 基于 Chromium 的 [`chrome.extension`](https://developer.chrome.com/docs/extensions/reference/extension/#property-inIncognitoContext) API。该文档衍生自 Chromium 代码中的 [`extension.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/extension.json)。 +> 此 API 基于 Chromium 的 [`chrome.extension`](https://developer.chrome.com/docs/extensions/reference/api/extension/#property-inIncognitoContext) API。该文档衍生自 Chromium 代码中的 [`extension.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/extension.json)。