Source code

Revision control

Other Tools

1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
* License, v. 2.0. If a copy of the MPL was not distributed with this
3
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5
[
6
{
7
"namespace": "manifest",
8
"types": [
9
{
10
"$extend": "Permission",
11
"choices": [
12
{
13
"type": "string",
14
"enum": [
15
"urlbar"
16
]
17
}
18
]
19
}
20
]
21
},
22
{
23
"namespace": "urlbar",
24
"description": "Use the <code>browser.urlbar</code> API to experiment with new features in the URLBar. Restricted to Mozilla privileged WebExtensions.",
25
"permissions": [
26
"urlbar"
27
],
28
"types": [
29
{
30
"id": "EngagementState",
31
"type": "string",
32
"enum": ["start", "engagement", "abandonment", "discard"],
33
"description": "The state of an engagement made with the urlbar by the user. <code>start</code>: The user has started an engagement. <code>engagement</code>: The user has completed an engagement by picking a result. <code>abandonment</code>: The user has abandoned their engagement, for example by blurring the urlbar. <code>discard</code>: The engagement ended in a way that should be ignored by listeners."
34
},
35
{
36
"id": "Query",
37
"type": "object",
38
"description": "A query performed in the urlbar.",
39
"properties": {
40
"isPrivate": {
41
"type": "boolean",
42
"description": "Whether the query's browser context is private."
43
},
44
"maxResults": {
45
"type": "integer",
46
"description": "The maximum number of results shown to the user."
47
},
48
"searchString": {
49
"type": "string",
50
"description": "The query's search string."
51
},
52
"sources": {
53
"type": "array",
54
"description": "List of acceptable source types to return.",
55
"items": {
56
"$ref": "SourceType"
57
}
58
}
59
}
60
},
61
{
62
"id": "Result",
63
"type": "object",
64
"description": "A result of a query. Queries can have many results. Each result is created by a provider.",
65
"properties": {
66
"payload": {
67
"type": "object",
68
"description": "An object with arbitrary properties depending on the result's type."
69
},
70
"source": {
71
"$ref": "SourceType",
72
"description": "The result's source."
73
},
74
"type": {
75
"$ref": "ResultType",
76
"description": "The result's type."
77
},
78
"suggestedIndex": {
79
"type": "integer",
80
"description": "Suggest a preferred position for this result within the result set.",
81
"optional": true,
82
"default": -1
83
}
84
}
85
},
86
{
87
"id": "ResultType",
88
"type": "string",
89
"enum": ["remote_tab", "search", "tab", "tip", "url"],
90
"description": "Possible types of results. <code>remote_tab</code>: A synced tab from another device. <code>search</code>: A search suggestion from a search engine. <code>tab</code>: An open tab in the browser. <code>tip</code>: An actionable message to help the user with their query. <code>url</code>: A URL that's not one of the other types."
91
},
92
{
93
"id": "SearchOptions",
94
"type": "object",
95
"description": "Options to the <code>search</code> function.",
96
"properties": {
97
"focus": {
98
"type": "boolean",
99
"optional": true,
100
"default": true,
101
"description": "Whether to focus the input field and select its contents."
102
}
103
}
104
},
105
{
106
"id": "SourceType",
107
"type": "string",
108
"enum": ["bookmarks", "history", "local", "network", "search", "tabs"],
109
"description": "Possible sources of results. <code>bookmarks</code>: The result comes from the user's bookmarks. <code>history</code>: The result comes from the user's history. <code>local</code>: The result comes from some local source not covered by another source type. <code>network</code>: The result comes from some network source not covered by another source type. <code>search</code>: The result comes from a search engine. <code>tabs</code>: The result is an open tab in the browser or a synced tab from another device."
110
}
111
],
112
"properties": {
113
"engagementTelemetry": {
114
"$ref": "types.Setting",
115
"description": "Enables or disables the engagement telemetry."
116
}
117
},
118
"functions": [
119
{
120
"name": "closeView",
121
"type": "function",
122
"async": true,
123
"description": "Closes the urlbar view in the current window.",
124
"parameters": []
125
},
126
{
127
"name": "focus",
128
"type": "function",
129
"async": true,
130
"description": "Focuses the urlbar in the current window.",
131
"parameters": [
132
{
133
"name": "select",
134
"type": "boolean",
135
"optional": true,
136
"default": false,
137
"description": "If true, the text in the urlbar will also be selected."
138
}
139
]
140
},
141
{
142
"name": "search",
143
"type": "function",
144
"async": true,
145
"description": "Starts a search in the urlbar in the current window.",
146
"parameters": [
147
{
148
"name": "searchString",
149
"type": "string",
150
"description": "The search string."
151
},
152
{
153
"name": "options",
154
"$ref": "SearchOptions",
155
"optional": true,
156
"default": {},
157
"description": "Options for the search."
158
}
159
]
160
}
161
],
162
"events": [
163
{
164
"name": "onBehaviorRequested",
165
"type": "function",
166
"description": "Before a query starts, this event is fired for the given provider. Its purpose is to request the provider's behavior for the query. The listener should return a behavior in response. By default, providers are inactive, so if your provider should always be inactive, you don't need to listen for this event.",
167
"parameters": [
168
{
169
"name": "query",
170
"$ref": "Query",
171
"description": "The query for which the behavior is requested."
172
}
173
],
174
"extraParameters": [
175
{
176
"name": "providerName",
177
"type": "string",
178
"pattern": "^[a-zA-Z0-9_-]+$",
179
"description": "The name of the provider whose behavior the listener returns."
180
}
181
],
182
"returns": {
183
"type": "string",
184
"enum": ["active", "inactive", "restricting"],
185
"description": "The behavior of the provider for the query."
186
}
187
},
188
{
189
"name": "onEngagement",
190
"type": "function",
191
"description": "This event is fired when the user starts and ends an engagement with the urlbar.",
192
"parameters": [
193
{
194
"name": "state",
195
"$ref": "EngagementState",
196
"description": "The state of the engagement."
197
}
198
],
199
"extraParameters": [
200
{
201
"name": "providerName",
202
"type": "string",
203
"pattern": "^[a-zA-Z0-9_-]+$",
204
"description": "The name of the provider that will listen for engagement events."
205
}
206
]
207
},
208
{
209
"name": "onQueryCanceled",
210
"type": "function",
211
"description": "This event is fired for the given provider when a query is canceled. The listener should stop any ongoing fetch or creation of results and clean up its resources.",
212
"parameters": [
213
{
214
"name": "query",
215
"$ref": "Query",
216
"description": "The query that was canceled."
217
}
218
],
219
"extraParameters": [
220
{
221
"name": "providerName",
222
"type": "string",
223
"pattern": "^[a-zA-Z0-9_-]+$",
224
"description": "The name of the provider that is creating results for the query."
225
}
226
]
227
},
228
{
229
"name": "onResultsRequested",
230
"type": "function",
231
"description": "When a query starts, this event is fired for the given provider if the provider is active for the query and there are no other providers that are restricting. Its purpose is to request the provider's results for the query. The listener should return a list of results in response.",
232
"parameters": [
233
{
234
"name": "query",
235
"$ref": "Query",
236
"description": "The query for which results are requested."
237
}
238
],
239
"extraParameters": [
240
{
241
"name": "providerName",
242
"type": "string",
243
"pattern": "^[a-zA-Z0-9_-]+$",
244
"description": "The name of the provider whose results the listener returns."
245
}
246
],
247
"returns": {
248
"type": "array",
249
"items": {
250
"$ref": "Result"
251
},
252
"description": "The results that the provider fetched for the query."
253
}
254
},
255
{
256
"name": "onResultPicked",
257
"type": "function",
258
"description": "Typically, a provider includes a <code>url</code> property in its results' payloads. When the user picks a result with a URL, Firefox automatically loads the URL. URLs don't make sense for every result type, however. When the user picks a result without a URL, this event is fired. The provider should take an appropriate action in response. Currently the only applicable <code>ResultType</code> is <code>tip</code>.",
259
"parameters": [
260
{
261
"name": "payload",
262
"type": "object",
263
"description": "The payload of the result that was picked."
264
}
265
],
266
"extraParameters": [
267
{
268
"name": "providerName",
269
"type": "string",
270
"pattern": "^[a-zA-Z0-9_-]+$",
271
"description": "The listener will be called for the results of the provider with this name."
272
}
273
]
274
}
275
]
276
}
277
]