-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into setimmediate-zh-cn
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
files/zh-cn/mozilla/add-ons/webextensions/api/omnibox/suggestresult/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
title: omnibox.SuggestResult | ||
slug: Mozilla/Add-ons/WebExtensions/API/omnibox/SuggestResult | ||
l10n: | ||
sourceCommit: b8a0743ca8b1e1b1b1a95cc93a4413c020f11262 | ||
--- | ||
|
||
{{AddonSidebar}} | ||
|
||
**`omnibox.SuggestResult`** 类型定义了扩展可以添加到地址栏下拉菜单中的建议。 | ||
|
||
扩展的 {{WebExtAPIRef("omnibox.onInputChanged")}} 事件监听器会传递一个回调函数。为了响应用户的输入将推荐填入地址栏下拉菜单,扩展可以将一个 `omnibox.SuggestResult` 对象数组传递给这个回调函数。 | ||
|
||
## 类型 | ||
|
||
这种类型的值是对象。它们包含如下属性: | ||
|
||
- `content` | ||
- : 当用户在下拉菜单中选择这个建议时,这个值将出现在地址栏中,并且这个值会同时被发送到 {{WebExtAPIRef("omnibox.onInputEntered")}} 事件监听器。如果字符串与用户已经输入的内容相同,则这个条目将不会出现在下拉菜单中。 | ||
- `deletable` | ||
- : 建议结果是否可以被用户删除。 | ||
- `description` | ||
- : 这是在地址栏下拉菜单中显示的字符串。 | ||
|
||
## 浏览器兼容性 | ||
|
||
{{Compat}} | ||
|
||
> [!NOTE] | ||
> 该 API 基于 Chromium 的 [`chrome.omnibox`](https://developer.chrome.google.cn/docs/extensions/reference/api/omnibox) API。 |