blob: 6b519d3d7f4203a6f1a4d0ee133ebe5973707d62 (
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
78
79
80
81
82
83
84
85
86
87
88
|
---
breadcrumbs:
- - /developers
- For Developers
- - /developers/design-documents
- Design Documents
- - /developers/design-documents/extensions
- Extensions
- - /developers/design-documents/extensions/proposed-changes
- Proposed & Proposing New Changes
- - /developers/design-documents/extensions/proposed-changes/apis-under-development
- API Proposals (New APIs Start Here)
page_name: omnibox-api
title: Omnibox API
---
### Status
Dream phase. The underlying omnibox API is fairly complex. This is a work in
progress, and likely incomplete / missing key bits.
### Overview
There are two goals for the omnibox extension API:
1. Register a keyword that would allow the extension author to provide
simple command hooks.
2. Be a full omnibox provider, with autocomplete matches.
### API
omnibox.
// The simple way:
// keyword-based (tab to search?) API. Perhaps usable to implement a basic
command-line interface.
// Register a keyword for handling in this extension.
void registerKeyword(string keyword)
// Called when the user enters text after using this extension's registered
keywords.
event onKeywordInput(string input)
// The hard way:
// Be a full-on omnibox provider.
// Notifies Omnibox that matches are ready, and provides them for browser-side
// use when the Omnibox wants them.
void matchesAvailable(Match\[\] matches)
// Called by the Omnibox when the text in the box has been changed.
// TODO: AutocompleteInput has a lot more info than this
event onInputChanged(string input)
// The user has requested that this match never show up in results again.
event onMatchDeleted(Match match)
struct Match {
int relevance
bool deletable
string fill_into_edit
int inline_autocomplete_offset
string destination_url
string contents
// missing content class
string description
// missing description class
}
|