Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(483)

Side by Side Diff: third_party/chrome/idl/declarative_web_request.json

Issue 12261015: Import chrome idl into third_party (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 [
6 {
7 "namespace": "declarativeWebRequest",
8 "documentation_permissions_required": ["declarative", "declarativeWebRequest "],
9 "types": [
10 {
11 "id": "HeaderFilter",
12 "type": "object",
13 "description": "Filters request headers for various criteria. Multiple c riteria are evaluated as a conjunction.",
14 "properties": {
15 "namePrefix": {
16 "description" : "Matches if the header name starts with the specifie d string.",
17 "type": "string",
18 "optional": true
19 },
20 "nameSuffix": {
21 "type": "string",
22 "optional": true,
23 "description" : "Matches if the header name ends with the specified string."
24 },
25 "nameContains": {
26 "choices": [
27 {"type": "array", "items": {"type": "string"}},
28 {"type": "string"}
29 ],
30 "optional": true,
31 "description" : "Matches if the header name contains all of the spec ified strings."
32 },
33 "nameEquals": {
34 "type": "string",
35 "optional": true,
36 "description" : "Matches if the header name is equal to the specifie d string."
37 },
38 "valuePrefix": {
39 "type": "string",
40 "optional": true,
41 "description" : "Matches if the header value starts with the specifi ed string."
42 },
43 "valueSuffix": {
44 "type": "string",
45 "optional": true,
46 "description" : "Matches if the header value ends with the specified string."
47 },
48 "valueContains": {
49 "choices": [
50 {"type": "array", "items": {"type": "string"}},
51 {"type": "string"}
52 ],
53 "optional": true,
54 "description" : "Matches if the header value contains all of the spe cified strings."
55 },
56 "valueEquals": {
57 "type": "string",
58 "optional": true,
59 "description" : "Matches if the header value is equal to the specifi ed string."
60 }
61 }
62 },
63 {
64 "id": "RequestMatcher",
65 "type": "object",
66 "description": "Matches network events by various criteria.",
67 "properties": {
68 "url": {
69 "$ref": "events.UrlFilter",
70 "description": "Matches if the conditions of the UrlFilter are fulfi lled for the URL of the request.",
71 "optional": true
72 },
73 "firstPartyForCookiesUrl": {
74 "$ref": "events.UrlFilter",
75 "description": "Matches if the conditions of the UrlFilter are fulfi lled for the 'first party' URL of the request. The 'first party' URL of a reques t, when present, can be different from the request's target URL, and describes w hat is considered 'first party' for the sake of third-party checks for cookies." ,
76 "optional": true
77 },
78 "resourceType": {
79 "type": "array",
80 "optional": true,
81 "description": "Matches if the request type of a request is containe d in the list. Requests that cannot match any of the types will be filtered out. ",
82 "items": { "type": "string", "enum": ["main_frame", "sub_frame", "st ylesheet", "script", "image", "object", "xmlhttprequest", "other"] }
83 },
84 "contentType": {
85 "type": "array",
86 "optional": true,
87 "description": "Matches if the MIME media type of a response (from t he HTTP Content-Type header) is contained in the list.",
88 "items": { "type": "string" }
89 },
90 "excludeContentType": {
91 "type": "array",
92 "optional": true,
93 "description": "Matches if the MIME media type of a response (from t he HTTP Content-Type header) is <em>not</em> contained in the list.",
94 "items": { "type": "string" }
95 },
96 "requestHeaders": {
97 "type": "array",
98 "optional": true,
99 "description": "Matches if some of the request headers is matched by one of the HeaderFilters.",
100 "items": { "$ref": "HeaderFilter" }
101 },
102 "excludeRequestHeaders": {
103 "type": "array",
104 "optional": true,
105 "description": "Matches if none of the request headers is matched by any of the HeaderFilters.",
106 "items": { "$ref": "HeaderFilter" }
107 },
108 "responseHeaders": {
109 "type": "array",
110 "optional": true,
111 "description": "Matches if some of the response headers is matched b y one of the HeaderFilters.",
112 "items": { "$ref": "HeaderFilter" }
113 },
114 "excludeResponseHeaders": {
115 "type": "array",
116 "optional": true,
117 "description": "Matches if none of the response headers is matched b y any of the HeaderFilters.",
118 "items": { "$ref": "HeaderFilter" }
119 },
120 "thirdPartyForCookies": {
121 "type": "boolean",
122 "optional": true,
123 "description": "If set to true, matches requests that are subject to third-party cookie policies. If set to false, matches all other requests."
124 },
125 "stages": {
126 "type": "array",
127 "items": {
128 "type": "string",
129 "enum": ["onBeforeRequest", "onBeforeSendHeaders", "onHeadersRecei ved", "onAuthRequired"]
130 },
131 "optional": true,
132 "description": "Contains a list of strings describing stages. Allowe d values are 'onBeforeRequest', 'onBeforeSendHeaders', 'onHeadersReceived', 'onA uthRequired'. If this attribute is present, then it limits the applicable stages to those listed. Note that the whole condition is only applicable in stages com patible with all attributes."
133 },
134 "instanceType": {
135 "type": "string", "enum": ["declarativeWebRequest.RequestMatcher"],
136 "nodoc": true
137 }
138 }
139 },
140 {
141 "id": "CancelRequest",
142 "description": "Declarative event action that cancels a network request. ",
143 "type": "object",
144 "properties": {
145 "instanceType": {
146 "type": "string", "enum": ["declarativeWebRequest.CancelRequest"],
147 "nodoc": true
148 }
149 }
150 },
151 {
152 "id": "RedirectRequest",
153 "description": "Declarative event action that redirects a network reques t.",
154 "type": "object",
155 "properties": {
156 "instanceType": {
157 "type": "string", "enum": ["declarativeWebRequest.RedirectRequest"],
158 "nodoc": true
159 },
160 "redirectUrl": { "type": "string", "description": "Destination to wher e the request is redirected."}
161 }
162 },
163 {
164 "id": "declarativeWebRequest.RedirectToTransparentImage",
165 "description": "Declarative event action that redirects a network reques t to a transparent image.",
166 "type": "object",
167 "properties": {
168 "instanceType": {
169 "type": "string", "enum": ["declarativeWebRequest.RedirectToTranspar entImage"],
170 "nodoc": true
171 }
172 }
173 },
174 {
175 "id": "declarativeWebRequest.RedirectToEmptyDocument",
176 "description": "Declarative event action that redirects a network reques t to an empty document.",
177 "type": "object",
178 "properties": {
179 "instanceType": {
180 "type": "string", "enum": ["declarativeWebRequest.RedirectToEmptyDoc ument"],
181 "nodoc": true
182 }
183 }
184 },
185 {
186 "id": "declarativeWebRequest.RedirectByRegEx",
187 "description": "Redirects a request by applying a regular expression on the URL. The regular expressions use the <a href=\"http://code.google.com/p/re2/ wiki/Syntax\">RE2 syntax</a>.",
188 "type": "object",
189 "properties": {
190 "instanceType": {
191 "type": "string", "enum": ["declarativeWebRequest.RedirectByRegEx"],
192 "nodoc": true
193 },
194 "from": {
195 "type": "string",
196 "description": "A match pattern that may contain capture groups. Cap ture groups are referenced in the Perl syntax ($1, $2, ...) instead of the RE2 s yntax (\\1, \\2, ...) in order to be closer to JavaScript Regular Expressions."
197 },
198 "to": {
199 "type": "string",
200 "description": "Destination pattern."
201 }
202 }
203 },
204 {
205 "id": "declarativeWebRequest.SetRequestHeader",
206 "description": "Sets the request header of the specified name to the spe cified value. If a header with the specified name did not exist before, a new on e is created. Header name comparison is always case-insensitive. Each request he ader name occurs only once in each request.",
207 "type": "object",
208 "properties": {
209 "instanceType": {
210 "type": "string", "enum": ["declarativeWebRequest.SetRequestHeader"] ,
211 "nodoc": true
212 },
213 "name": {
214 "type": "string",
215 "description": "HTTP request header name."
216 },
217 "value": {
218 "type": "string",
219 "description": "HTTP request header value."
220 }
221 }
222 },
223 {
224 "id": "declarativeWebRequest.RemoveRequestHeader",
225 "description": "Removes the request header of the specified name. Do not use SetRequestHeader and RemoveRequestHeader with the same header name on the s ame request. Each request header name occurs only once in each request.",
226 "type": "object",
227 "properties": {
228 "instanceType": {
229 "type": "string", "enum": ["declarativeWebRequest.RemoveRequestHeade r"],
230 "nodoc": true
231 },
232 "name": {
233 "type": "string",
234 "description": "HTTP request header name (case-insensitive)."
235 }
236 }
237 },
238 {
239 "id": "declarativeWebRequest.AddResponseHeader",
240 "description": "Adds the response header to the response of this web req uest. As multiple response headers may share the same name, you need to first re move and then add a new response header in order to replace one.",
241 "type": "object",
242 "properties": {
243 "instanceType": {
244 "type": "string", "enum": ["declarativeWebRequest.AddResponseHeader" ],
245 "nodoc": true
246 },
247 "name": {
248 "type": "string",
249 "description": "HTTP response header name."
250 },
251 "value": {
252 "type": "string",
253 "description": "HTTP response header value."
254 }
255 }
256 },
257 {
258 "id": "declarativeWebRequest.RemoveResponseHeader",
259 "description": "Removes all response headers of the specified names and values.",
260 "type": "object",
261 "properties": {
262 "instanceType": {
263 "type": "string", "enum": ["declarativeWebRequest.RemoveResponseHead er"],
264 "nodoc": true
265 },
266 "name": {
267 "type": "string",
268 "description": "HTTP request header name (case-insensitive)."
269 },
270 "value": {
271 "type": "string",
272 "description": "HTTP request header value (case-insensitive).",
273 "optional": true
274 }
275 }
276 },
277 {
278 "id": "declarativeWebRequest.IgnoreRules",
279 "description": "Masks all rules that match the specified criteria.",
280 "type": "object",
281 "properties": {
282 "instanceType": {
283 "type": "string", "enum": ["declarativeWebRequest.IgnoreRules"],
284 "nodoc": true
285 },
286 "lowerPriorityThan": {
287 "type": "integer",
288 "description": "If set, rules with a lower priority than the specifi ed value are ignored. This boundary is not persisted, it affects only rules and their actions of the same network request stage."
289 }
290 }
291 },
292 {
293 "id": "declarativeWebRequest.SendMessageToExtension",
294 "description": "Triggers the $ref:declarativeWebRequest.onMessage event. ",
295 "type": "object",
296 "properties": {
297 "instanceType": {
298 "type": "string", "enum": ["declarativeWebRequest.SendMessageToExten sion"],
299 "nodoc": true
300 },
301 "message": {
302 "type": "string",
303 "description": "The value that will be passed in the <code>message</ code> attribute of the dictionary that is passed to the event handler."
304 }
305 }
306 },
307 {
308 "id": "declarativeWebRequest.RequestCookie",
309 "description": "A filter or specification of a cookie in HTTP Requests." ,
310 "type": "object",
311 "properties": {
312 "name": {
313 "type": "string",
314 "description": "Name of a cookie.",
315 "optional": true
316 },
317 "value": {
318 "type": "string",
319 "description": "Value of a cookie, may be padded in double-quotes.",
320 "optional": true
321 }
322 }
323 },
324 {
325 "id": "declarativeWebRequest.ResponseCookie",
326 "description": "A specification of a cookie in HTTP Responses.",
327 "type": "object",
328 "properties": {
329 "name": {
330 "type": "string",
331 "description": "Name of a cookie.",
332 "optional": true
333 },
334 "value": {
335 "type": "string",
336 "description": "Value of a cookie, may be padded in double-quotes.",
337 "optional": true
338 },
339 "expires": {
340 "type": "string",
341 "description": "Value of the Expires cookie attribute.",
342 "optional": true
343 },
344 "maxAge": {
345 "type": "number",
346 "description": "Value of the Max-Age cookie attribute",
347 "optional": true
348 },
349 "domain": {
350 "type": "string",
351 "description": "Value of the Domain cookie attribute.",
352 "optional": true
353 },
354 "path": {
355 "type": "string",
356 "description": "Value of the Path cookie attribute.",
357 "optional": true
358 },
359 "secure": {
360 "type": "string",
361 "description": "Existence of the Secure cookie attribute.",
362 "optional": true
363 },
364 "httpOnly": {
365 "type": "string",
366 "description": "Existence of the HttpOnly cookie attribute.",
367 "optional": true
368 }
369 }
370 },
371 {
372 "id": "declarativeWebRequest.FilterResponseCookie",
373 "description": "A filter of a cookie in HTTP Responses.",
374 "type": "object",
375 "properties": {
376 "name": {
377 "type": "string",
378 "description": "Name of a cookie.",
379 "optional": true
380 },
381 "value": {
382 "type": "string",
383 "description": "Value of a cookie, may be padded in double-quotes.",
384 "optional": true
385 },
386 "expires": {
387 "type": "string",
388 "description": "Value of the Expires cookie attribute.",
389 "optional": true
390 },
391 "maxAge": {
392 "type": "number",
393 "description": "Value of the Max-Age cookie attribute",
394 "optional": true
395 },
396 "domain": {
397 "type": "string",
398 "description": "Value of the Domain cookie attribute.",
399 "optional": true
400 },
401 "path": {
402 "type": "string",
403 "description": "Value of the Path cookie attribute.",
404 "optional": true
405 },
406 "secure": {
407 "type": "string",
408 "description": "Existence of the Secure cookie attribute.",
409 "optional": true
410 },
411 "httpOnly": {
412 "type": "string",
413 "description": "Existence of the HttpOnly cookie attribute.",
414 "optional": true
415 },
416 "ageUpperBound": {
417 "type": "integer",
418 "description": "Inclusive upper bound on the cookie lifetime (specif ied in seconds after current time). Only cookies whose expiration date-time is i n the interval [now, now + ageUpperBound] fulfill this criterion. Session cookie s and cookies whose expiration date-time is in the past do not meet the criterio n of this filter. The cookie lifetime is calculated from either 'max-age' or 'ex pires' cookie attributes. If both are specified, 'max-age' is used to calculate the cookie lifetime.",
419 "minimum": 0,
420 "optional": true
421 },
422 "ageLowerBound": {
423 "type": "integer",
424 "description": "Inclusive lower bound on the cookie lifetime (specif ied in seconds after current time). Only cookies whose expiration date-time is s et to 'now + ageLowerBound' or later fulfill this criterion. Session cookies do not meet the criterion of this filter. The cookie lifetime is calculated from ei ther 'max-age' or 'expires' cookie attributes. If both are specified, 'max-age' is used to calculate the cookie lifetime.",
425 "minimum": 0,
426 "optional": true
427 },
428 "sessionCookie": {
429 "type": "boolean",
430 "description": "Filters session cookies. Session cookies have no lif etime specified in any of 'max-age' or 'expires' attributes.",
431 "optional": true
432 }
433 }
434 },
435 {
436 "id": "declarativeWebRequest.AddRequestCookie",
437 "description": "Adds a cookie to the request or overrides a cookie, in c ase another cookie of the same name exists already. Note that it is preferred to use the Cookies API because this is computationally less expensive.",
438 "type": "object",
439 "properties": {
440 "instanceType": {
441 "type": "string", "enum": ["declarativeWebRequest.AddRequestCookie"] ,
442 "nodoc": true
443 },
444 "cookie": {
445 "$ref": "declarativeWebRequest.RequestCookie",
446 "description": "Cookie to be added to the request. No field may be u ndefined."
447 }
448 }
449 },
450 {
451 "id": "declarativeWebRequest.AddResponseCookie",
452 "description": "Adds a cookie to the response or overrides a cookie, in case another cookie of the same name exists already. Note that it is preferred t o use the Cookies API because this is computationally less expensive.",
453 "type": "object",
454 "properties": {
455 "instanceType": {
456 "type": "string", "enum": ["declarativeWebRequest.AddResponseCookie" ],
457 "nodoc": true
458 },
459 "cookie": {
460 "$ref": "declarativeWebRequest.ResponseCookie",
461 "description": "Cookie to be added to the response. The name and val ue need to be specified."
462 }
463 }
464 },
465 {
466 "id": "declarativeWebRequest.EditRequestCookie",
467 "description": "Edits one or more cookies of request. Note that it is pr eferred to use the Cookies API because this is computationally less expensive.",
468 "type": "object",
469 "properties": {
470 "instanceType": {
471 "type": "string", "enum": ["declarativeWebRequest.EditRequestCookie" ],
472 "nodoc": true
473 },
474 "filter": {
475 "$ref": "declarativeWebRequest.RequestCookie",
476 "description": "Filter for cookies that will be modified. All empty entries are ignored."
477 },
478 "modification": {
479 "$ref": "declarativeWebRequest.RequestCookie",
480 "description": "Attributes that shall be overridden in cookies that machted the filter. Attributes that are set to an empty string are removed."
481 }
482 }
483 },
484 {
485 "id": "declarativeWebRequest.EditResponseCookie",
486 "description": "Edits one or more cookies of response. Note that it is p referred to use the Cookies API because this is computationally less expensive." ,
487 "type": "object",
488 "properties": {
489 "instanceType": {
490 "type": "string", "enum": ["declarativeWebRequest.EditResponseCookie "],
491 "nodoc": true
492 },
493 "filter": {
494 "$ref": "declarativeWebRequest.FilterResponseCookie",
495 "description": "Filter for cookies that will be modified. All empty entries are ignored."
496 },
497 "modification": {
498 "$ref": "declarativeWebRequest.ResponseCookie",
499 "description": "Attributes that shall be overridden in cookies that machted the filter. Attributes that are set to an empty string are removed."
500 }
501 }
502 },
503 {
504 "id": "declarativeWebRequest.RemoveRequestCookie",
505 "description": "Removes one or more cookies of request. Note that it is preferred to use the Cookies API because this is computationally less expensive. ",
506 "type": "object",
507 "properties": {
508 "instanceType": {
509 "type": "string", "enum": ["declarativeWebRequest.RemoveRequestCooki e"],
510 "nodoc": true
511 },
512 "filter": {
513 "$ref": "declarativeWebRequest.RequestCookie",
514 "description": "Filter for cookies that will be removed. All empty e ntries are ignored."
515 }
516 }
517 },
518 {
519 "id": "declarativeWebRequest.RemoveResponseCookie",
520 "description": "Removes one or more cookies of response. Note that it is preferred to use the Cookies API because this is computationally less expensive .",
521 "type": "object",
522 "properties": {
523 "instanceType": {
524 "type": "string", "enum": ["declarativeWebRequest.RemoveResponseCook ie"],
525 "nodoc": true
526 },
527 "filter": {
528 "$ref": "declarativeWebRequest.FilterResponseCookie",
529 "description": "Filter for cookies that will be removed. All empty e ntries are ignored."
530 }
531 }
532 }
533 ],
534 "functions": [
535 ],
536 "events": [
537 {
538 "name": "onRequest",
539 "options": {
540 "supportsListeners": false,
541 "supportsRules": true,
542 "conditions": ["declarativeWebRequest.RequestMatcher"],
543 "actions": [
544 "declarativeWebRequest.AddRequestCookie",
545 "declarativeWebRequest.AddResponseCookie",
546 "declarativeWebRequest.AddResponseHeader",
547 "declarativeWebRequest.CancelRequest",
548 "declarativeWebRequest.EditRequestCookie",
549 "declarativeWebRequest.EditResponseCookie",
550 "declarativeWebRequest.RedirectRequest",
551 "declarativeWebRequest.RedirectToTransparentImage",
552 "declarativeWebRequest.RedirectToEmptyDocument",
553 "declarativeWebRequest.RedirectByRegEx",
554 "declarativeWebRequest.RemoveRequestCookie",
555 "declarativeWebRequest.RemoveResponseCookie",
556 "declarativeWebRequest.RemoveRequestHeader",
557 "declarativeWebRequest.RemoveResponseHeader",
558 "declarativeWebRequest.SetRequestHeader",
559 "declarativeWebRequest.SendMessageToExtension",
560 "declarativeWebRequest.IgnoreRules"
561 ]
562 }
563 },
564 {
565 "name": "onMessage",
566 "type": "function",
567 "description": "Fired when a message is sent via $ref:declarativeWebRequ est.SendMessageToExtension from an action of the declarative web request API.",
568 "parameters": [
569 {
570 "type": "object",
571 "name": "details",
572 "properties": {
573 "message": {"type": "string", "description": "The message sent by the calling script."},
574 "stage": {"type": "string",
575 "enum": ["onBeforeRequest", "onBeforeSendHeaders", "onHe adersReceived", "onAuthRequired"],
576 "description": "The stage of the network request during which the event was triggered."},
577 "requestId": {"type": "string", "description": "The ID of the requ est. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},
578 "url": {"type": "string"},
579 "method": {"type": "string", "description": "Standard HTTP method. "},
580 "frameId": {"type": "integer", "description": "The value 0 indicat es that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>) , <code>frameId</code> indicates the ID of this frame, not the ID of the outer f rame. Frame IDs are unique within a tab."},
581 "parentFrameId": {"type": "integer", "description": "ID of frame t hat wraps the frame which sent the request. Set to -1 if no parent frame exists. "},
582 "tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab." },
583 "type": {"type": "string", "enum": ["main_frame", "sub_frame", "st ylesheet", "script", "image", "object", "xmlhttprequest", "other"], "description ": "How the requested resource will be used."},
584 "timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."}
585 }
586 }
587 ]
588 }
589 ]
590 }
591 ]
OLDNEW
« no previous file with comments | « third_party/chrome/idl/declarative_content.json ('k') | third_party/chrome/idl/developer_private.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698