blob: 422c9cf55c12cf9e64defc8051c2d781ab3dc189 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
<div id="pageData-name" class="pageData">Omnibox</div>
<!-- BEGIN AUTHORED CONTENT -->
<p>
The omnibox API allows you to register a
keyword with Google Chrome's address bar,
which is also known as the omnibox.
</p>
<p>
<img src="images/omnibox.png" width="300" height="150"
alt="A screenshot showing suggestions related to the keyword 'Chromium Search'"/>
</p>
<p>
When the user enters your extension's
keyword, the user starts
interacting solely with your extension.
Each keystroke is sent to your
extension, and you can provide suggestions
in response.
</p>
<p>
The suggestions can be richly formatted
in a variety of ways.
<!-- PENDING: for example? (include a mention of method name, maybe show a code snippet) -->
When the user accepts
a suggestion, your extension is notified
and can take action.
</p>
<h2 id="manifest">Manifest</h2>
<p>
You must include an <code>omnibox</code> <code>keyword</code> field
in the <a href="manifest.html">manifest</a>
to use the omnibox API.
You should also
specify a 16x16-pixel icon, which will be
displayed in the address bar when suggesting that users
enter keyword mode.
</p>
<p>
For example:
</p>
<pre>{
"name": "Aaron's omnibox extension",
"version": "1.0",
<b>"omnibox": { "keyword" : "aaron" },</b>
<b>"icons": {</b>
<b>"16": "16-full-color.png"</b>
<b>},</b>
"background_page": "background.html"
}</pre>
<p class="note">
<strong>Note:</strong>
Chrome automatically creates a grayscale version of
your 16x16-pixel icon. You should provide
a full-color version so that it can also be
used in other situations that require color.
For example, the <a href="contextMenus.html"
>context menus API</a> also uses a 16x16-pixel
icon, but it is displayed in color.
</p>
<h2 id="examples">Examples</h2>
<p>
You can find samples of this API on the
<a href="samples.html#omnibox">sample page</a>.
<!-- END AUTHORED CONTENT -->
|