Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / common / extensions / api / content_settings.json
blob455c8701a8eb1318a02027b992df9fd95ee67864
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.
6   {
7     "namespace": "contentSettings",
8     "description": "Use the <code>chrome.contentSettings</code> API to change settings that control whether websites can use features such as cookies, JavaScript, and plugins. More generally speaking, content settings allow you to customize Chrome's behavior on a per-site basis instead of globally.",
9     "compiler_options": {
10       "generate_type_functions": true
11     },
12     "types": [
13       {
14         "id": "ResourceIdentifier",
15         "type": "object",
16         "properties": {
17           "id": {
18             "type": "string",
19             "description": "The resource identifier for the given content type."
20           },
21           "description": {
22             "type": "string",
23             "optional": true,
24             "description": "A human readable description of the resource."
25           }
26         },
27         "description": "The only content type using resource identifiers is $(ref:contentSettings.plugins). For more information, see <a href=\"contentSettings#resource-identifiers\">Resource Identifiers</a>."
28       },
29       {
30         "id": "Scope",
31         "type": "string",
32         "enum": ["regular", "incognito_session_only"],
33         "description": "The scope of the ContentSetting. One of<br><var>regular</var>: setting for regular profile (which is inherited by the incognito profile if not overridden elsewhere),<br><var>incognito_session_only</var>: setting for incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular settings)."
34       },
35       {
36         "id": "ContentSetting",
37         "js_module": "ContentSetting",
38         "type": "object",
39         "functions": [
40           {
41             "name": "clear",
42             "type": "function",
43             "description": "Clear all content setting rules set by this extension.",
44             "parameters": [
45               {
46                 "name": "details",
47                 "type": "object",
48                 "properties": {
49                   "scope": {
50                     "$ref": "Scope",
51                     "optional": true,
52                     "description": "Where to clear the setting (default: regular)."
53                   }
54                 }
55               },
56               {
57                 "type": "function",
58                 "name": "callback",
59                 "optional": true,
60                 "parameters": []
61               }
62             ]
63           },
64           {
65             "name": "get",
66             "type": "function",
67             "description": "Gets the current content setting for a given pair of URLs.",
68             "parameters": [
69               {
70                 "name": "details",
71                 "type": "object",
72                 "properties": {
73                   "primaryUrl": {
74                     "type": "string",
75                     "description": "The primary URL for which the content setting should be retrieved. Note that the meaning of a primary URL depends on the content type."
76                   },
77                   "secondaryUrl": {
78                     "type": "string",
79                     "description": "The secondary URL for which the content setting should be retrieved. Defaults to the primary URL. Note that the meaning of a secondary URL depends on the content type, and not all content types use secondary URLs.",
80                     "optional": true
81                   },
82                   "resourceIdentifier": {
83                     "$ref": "ResourceIdentifier",
84                     "optional": true,
85                     "description": "A more specific identifier of the type of content for which the settings should be retrieved."
86                   },
87                   "incognito": {
88                     "type": "boolean",
89                     "optional": true,
90                     "description": "Whether to check the content settings for an incognito session. (default false)"
91                   }
92                 }
93               },
94               {
95                 "type": "function",
96                 "name": "callback",
97                 "parameters": [
98                   {
99                     "name": "details",
100                     "type": "object",
101                     "properties": {
102                       "setting": {
103                         "type": "any",
104                         "description": "The content setting. See the description of the individual ContentSetting objects for the possible values."
105                       }
106                     }
107                   }
108                 ]
109               }
110             ]
111           },
112           {
113             "name": "set",
114             "type": "function",
115             "description": "Applies a new content setting rule.",
116             "parameters": [
117               {
118                 "name": "details",
119                 "type": "object",
120                 "properties": {
121                   "primaryPattern": {
122                     "type": "string",
123                     "description": "The pattern for the primary URL. For details on the format of a pattern, see <a href='contentSettings#patterns'>Content Setting Patterns</a>."
124                   },
125                   "secondaryPattern": {
126                     "type": "string",
127                     "description": "The pattern for the secondary URL. Defaults to matching all URLs. For details on the format of a pattern, see <a href='contentSettings#patterns'>Content Setting Patterns</a>.",
128                     "optional": true
129                   },
130                   "resourceIdentifier": {
131                     "$ref": "ResourceIdentifier",
132                     "optional": true,
133                     "description": "The resource identifier for the content type."
134                   },
135                   "setting": {
136                     "type": "any",
137                     "description": "The setting applied by this rule. See the description of the individual ContentSetting objects for the possible values."
138                   },
139                   "scope": {
140                     "$ref": "Scope",
141                     "optional": true,
142                     "description": "Where to set the setting (default: regular)."
143                   }
144                 }
145               },
146               {
147                 "type": "function",
148                 "name": "callback",
149                 "optional": true,
150                 "parameters": []
151               }
152             ]
153           },
154           {
155             "name": "getResourceIdentifiers",
156             "type": "function",
157             "description": "",
158             "parameters": [
159               {
160                 "name": "callback",
161                 "type": "function",
162                 "parameters": [
163                   {
164                     "name": "resourceIdentifiers",
165                     "type": "array",
166                     "description": "A list of resource identifiers for this content type, or <var>undefined</var> if this content type does not use resource identifiers.",
167                     "optional": true,
168                     "items": {
169                       "$ref": "ResourceIdentifier"
170                     }
171                   }
172                 ]
173               }
174             ]
175           }
176         ]
177       },
178       {
179         "id": "CookiesContentSetting",
180         "type": "string",
181         "enum": ["allow", "block", "session_only"]
182       },
183       {
184         "id": "ImagesContentSetting",
185         "type": "string",
186         "enum": ["allow", "block"]
187       },
188       {
189         "id": "JavascriptContentSetting",
190         "type": "string",
191         "enum": ["allow", "block"]
192       },
193       {
194         "id": "LocationContentSetting",
195         "type": "string",
196         "enum": ["allow", "block", "ask"]
197       },
198       {
199         "id": "PluginsContentSetting",
200         "type": "string",
201         "enum": ["allow", "block", "detect_important_content"]
202       },
203       {
204         "id": "PopupsContentSetting",
205         "type": "string",
206         "enum": ["allow", "block"]
207       },
208       {
209         "id": "NotificationsContentSetting",
210         "type": "string",
211         "enum": ["allow", "block", "ask"]
212       },
213       {
214         "id": "FullscreenContentSetting",
215         "type": "string",
216         "enum": ["allow", "ask"]
217       },
218       {
219         "id": "MouselockContentSetting",
220         "type": "string",
221         "enum": ["allow", "block", "ask"]
222       },
223       {
224         "id": "MicrophoneContentSetting",
225         "type": "string",
226         "enum": ["allow", "block", "ask"]
227       },
228       {
229         "id": "CameraContentSetting",
230         "type": "string",
231         "enum": ["allow", "block", "ask"]
232       },
233       {
234         "id": "PpapiBrokerContentSetting",
235         "type": "string",
236         "enum": ["allow", "block", "ask"]
237       },
238       {
239         "id": "MultipleAutomaticDownloadsContentSetting",
240         "type": "string",
241         "enum": ["allow", "block", "ask"]
242       }
243     ],
244     "properties": {
245       "cookies": {
246         "$ref": "ContentSetting",
247         "description": "Whether to allow cookies and other local data to be set by websites. One of<br><var>allow</var>: Accept cookies,<br><var>block</var>: Block cookies,<br><var>session_only</var>: Accept cookies only for the current session. <br>Default is <var>allow</var>.<br>The primary URL is the URL representing the cookie origin. The secondary URL is the URL of the top-level frame.",
248         "value": [
249           "cookies",
250           {"$ref":"CookiesContentSetting"}
251         ]
252       },
253       "images": {
254         "$ref": "ContentSetting",
255         "description": "Whether to show images. One of<br><var>allow</var>: Show images,<br><var>block</var>: Don't show images. <br>Default is <var>allow</var>.<br>The primary URL is the URL of the top-level frame. The secondary URL is the URL of the image.",
256         "value": [
257           "images",
258           {"$ref":"ImagesContentSetting"}
259         ]
260       },
261       "javascript": {
262         "$ref": "ContentSetting",
263         "description": "Whether to run JavaScript. One of<br><var>allow</var>: Run JavaScript,<br><var>block</var>: Don't run JavaScript. <br>Default is <var>allow</var>.<br>The primary URL is the URL of the top-level frame. The secondary URL is not used.",
264         "value": [
265           "javascript",
266           {"$ref":"JavascriptContentSetting"}
267         ]
268       },
269       "location": {
270         "$ref": "ContentSetting",
271         "description": "Whether to allow Geolocation. One of <br><var>allow</var>: Allow sites to track your physical location,<br><var>block</var>: Don't allow sites to track your physical location,<br><var>ask</var>: Ask before allowing sites to track your physical location. <br>Default is <var>ask</var>.<br>The primary URL is the URL of the document which requested location data. The secondary URL is the URL of the top-level frame (which may or may not differ from the requesting URL).",
272         "value": [
273           "geolocation",
274           {"$ref":"LocationContentSetting"}
275         ]
276       },
277       "plugins": {
278         "$ref": "ContentSetting",
279         "description": "Whether to run plugins. One of<br><var>allow</var>: Run plugins automatically,<br><var>block</var>: Don't run plugins automatically,<br><var>detect_important_content</var>: Only run automatically those plugins that are detected as the website's main content.<br>The primary URL is the URL of the top-level frame. The secondary URL is not used.",
280         "value": [
281           "plugins",
282           {"$ref":"PluginsContentSetting"}
283         ]
284       },
285       "popups": {
286         "$ref": "ContentSetting",
287         "description": "Whether to allow sites to show pop-ups. One of<br><var>allow</var>: Allow sites to show pop-ups,<br><var>block</var>: Don't allow sites to show pop-ups. <br>Default is <var>block</var>.<br>The primary URL is the URL of the top-level frame. The secondary URL is not used.",
288         "value": [
289           "popups",
290           {"$ref":"PopupsContentSetting"}
291         ]
292       },
293       "notifications": {
294         "$ref": "ContentSetting",
295         "description": "Whether to allow sites to show desktop notifications. One of<br><var>allow</var>: Allow sites to show desktop notifications,<br><var>block</var>: Don't allow sites to show desktop notifications,<br><var>ask</var>: Ask when a site wants to show desktop notifications. <br>Default is <var>ask</var>.<br>The primary URL is the URL of the document which wants to show the notification. The secondary URL is not used.",
296         "value": [
297           "notifications",
298           {"$ref":"NotificationsContentSetting"}
299         ]
300       },
301       "fullscreen": {
302         "$ref": "ContentSetting",
303         "description": "Whether to allow sites to toggle the fullscreen mode. One of<br><var>allow</var>: Allow sites to toggle the fullscreen mode,<br><var>ask</var>: Ask when a site wants to toggle the fullscreen mode. <br>Default is <var>ask</var>.<br>The primary URL is the URL of the document which requested to toggle the fullscreen mode. The secondary URL is the URL of the top-level frame (which may or may not differ from the requesting URL).",
304         "value": [
305           "fullscreen",
306           {"$ref":"FullscreenContentSetting"}
307         ]
308       },
309       "mouselock": {
310         "$ref": "ContentSetting",
311         "description": "Whether to allow sites to disable the mouse cursor. One of <br><var>allow</var>: Allow sites to disable the mouse cursor,<br><var>block</var>: Don't allow sites to disable the mouse cursor,<br><var>ask</var>: Ask when a site wants to disable the mouse cursor. <br>Default is <var>ask</var>.<br>The primary URL is the URL of the top-level frame. The secondary URL is not used.",
312         "value": [
313           "mouselock",
314           {"$ref":"MouselockContentSetting"}
315         ]
316       },
317       "microphone": {
318         "$ref": "ContentSetting",
319         "description": "Whether to allow sites to access the microphone. One of <br><var>allow</var>: Allow sites to access the microphone,<br><var>block</var>: Don't allow sites to access the microphone,<br><var>ask</var>: Ask when a site wants to access the microphone. <br>Default is <var>ask</var>.<br>The primary URL is the URL of the document which requested microphone access. The secondary URL is not used.<br>NOTE: The 'allow' setting is not valid if both patterns are '<all_urls>'.",
320         "value": [
321           "media-stream-mic",
322           {"$ref":"MicrophoneContentSetting"}
323         ]
324       },
325       "camera": {
326         "$ref": "ContentSetting",
327         "description": "Whether to allow sites to access the camera. One of <br><var>allow</var>: Allow sites to access the camera,<br><var>block</var>: Don't allow sites to access the camera,<br><var>ask</var>: Ask when a site wants to access the camera. <br>Default is <var>ask</var>.<br>The primary URL is the URL of the document which requested camera access. The secondary URL is not used.<br>NOTE: The 'allow' setting is not valid if both patterns are '<all_urls>'.",
328         "value": [
329           "media-stream-camera",
330           {"$ref":"CameraContentSetting"}
331         ]
332       },
333       "unsandboxedPlugins": {
334         "$ref": "ContentSetting",
335         "description": "Whether to allow sites to run plugins unsandboxed. One of <br><var>allow</var>: Allow sites to run plugins unsandboxed,<br><var>block</var>: Don't allow sites to run plugins unsandboxed,<br><var>ask</var>: Ask when a site wants to run a plugin unsandboxed. <br>Default is <var>ask</var>.<br>The primary URL is the URL of the top-level frame. The secondary URL is not used.",
336         "value": [
337           "ppapi-broker",
338           {"$ref":"PpapiBrokerContentSetting"}
339         ]
340       },
341       "automaticDownloads": {
342         "$ref": "ContentSetting",
343         "description": "Whether to allow sites to download multiple files automatically. One of <br><var>allow</var>: Allow sites to download multiple files automatically,<br><var>block</var>: Don't allow sites to download multiple files automatically,<br><var>ask</var>: Ask when a site wants to download files automatically after the first file. <br>Default is <var>ask</var>.<br>The primary URL is the URL of the top-level frame. The secondary URL is not used.",
344         "value": [
345           "automatic-downloads",
346           {"$ref":"MultipleAutomaticDownloadsContentSetting"}
347         ]
348       }
349     }
350   }