OLD | NEW |
| (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": "contentSettings", | |
8 "description": "The contentSettings API.", | |
9 "types": [ | |
10 { | |
11 "id": "ResourceIdentifier", | |
12 "type": "object", | |
13 "properties": { | |
14 "id": { | |
15 "type": "string", | |
16 "description": "The resource identifier for the given content type." | |
17 }, | |
18 "description": { | |
19 "type": "string", | |
20 "optional": true, | |
21 "description": "A human readable description of the resource." | |
22 } | |
23 }, | |
24 "description": "The only content type using resource identifiers is <a h
ref=\"contentSettings.html#property-plugins\"><var>plugins</var></a>. For more i
nformation, see <a href=\"contentSettings.html#resource-identifiers\">Resource I
dentifiers</a>." | |
25 }, | |
26 { | |
27 "id": "ContentSetting", | |
28 "type": "object", | |
29 "functions": [ | |
30 { | |
31 "name": "clear", | |
32 "type": "function", | |
33 "description": "Clear all content setting rules set by this extensio
n.", | |
34 "parameters": [ | |
35 { | |
36 "name": "details", | |
37 "type": "object", | |
38 "properties": { | |
39 "scope": { | |
40 "type": "string", | |
41 "enum": ["regular", "incognito_session_only"], | |
42 "optional": true, | |
43 "description": "Where to set the setting (default: regular).
One of<br><var>regular</var>: setting for regular profile (which is inherited b
y the incognito profile if not overridden elsewhere),<br><var>incognito_session_
only</var>: setting for incognito profile that can only be set during an incogni
to session and is deleted when the incognito session ends (overrides regular set
tings)." | |
44 } | |
45 } | |
46 }, | |
47 { | |
48 "type": "function", | |
49 "name": "callback", | |
50 "optional": true, | |
51 "parameters": [] | |
52 } | |
53 ] | |
54 }, | |
55 { | |
56 "name": "get", | |
57 "type": "function", | |
58 "description": "Gets the current content setting for a given pair of
URLs.", | |
59 "parameters": [ | |
60 { | |
61 "name": "details", | |
62 "type": "object", | |
63 "properties": { | |
64 "primaryUrl": { | |
65 "type": "string", | |
66 "description": "The primary URL for which the content settin
g should be retrieved. Note that the meaning of a primary URL depends on the con
tent type." | |
67 }, | |
68 "secondaryUrl": { | |
69 "type": "string", | |
70 "description": "The secondary URL for which the content sett
ing 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 second
ary URLs.", | |
71 "optional": true | |
72 }, | |
73 "resourceIdentifier": { | |
74 "$ref": "ResourceIdentifier", | |
75 "optional": true, | |
76 "description": "A more specific identifier of the type of co
ntent for which the settings should be retrieved." | |
77 }, | |
78 "incognito": { | |
79 "type": "boolean", | |
80 "optional": true, | |
81 "description": "Whether to check the content settings for an
incognito session. (default false)" | |
82 } | |
83 } | |
84 }, | |
85 { | |
86 "type": "function", | |
87 "name": "callback", | |
88 "parameters": [ | |
89 { | |
90 "name": "details", | |
91 "type": "object", | |
92 "properties": { | |
93 "setting": { | |
94 "type": "any", | |
95 "description": "The content setting. See the description
of the individual ContentSetting objects for the possible values." | |
96 } | |
97 } | |
98 } | |
99 ] | |
100 } | |
101 ] | |
102 }, | |
103 { | |
104 "name": "set", | |
105 "type": "function", | |
106 "description": "Applies a new content setting rule.", | |
107 "parameters": [ | |
108 { | |
109 "name": "details", | |
110 "type": "object", | |
111 "properties": { | |
112 "primaryPattern": { | |
113 "type": "string", | |
114 "description": "The pattern for the primary URL. For details
on the format of a pattern, see <a href='contentSettings.html#patterns'>Content
Setting Patterns</a>." | |
115 }, | |
116 "secondaryPattern": { | |
117 "type": "string", | |
118 "description": "The pattern for the secondary URL. Defaults
to matching all URLs. For details on the format of a pattern, see <a href='conte
ntSettings.html#patterns'>Content Setting Patterns</a>.", | |
119 "optional": true | |
120 }, | |
121 "resourceIdentifier": { | |
122 "$ref": "ResourceIdentifier", | |
123 "optional": true, | |
124 "description": "The resource identifier for the content type
." | |
125 }, | |
126 "setting": { | |
127 "type": "any", | |
128 "description": "The setting applied by this rule. See the de
scription of the individual ContentSetting objects for the possible values." | |
129 }, | |
130 "scope": { | |
131 "type": "string", | |
132 "enum": ["regular", "incognito_session_only"], | |
133 "optional": true, | |
134 "description": "Where to clear the setting (default: regular
). One of<br><var>regular</var>: setting for regular profile (which is inherited
by the incognito profile if not overridden elsewhere),<br><var>incognito_sessio
n_only</var>: setting for incognito profile that can only be set during an incog
nito session and is deleted when the incognito session ends (overrides regular s
ettings)." | |
135 } | |
136 } | |
137 }, | |
138 { | |
139 "type": "function", | |
140 "name": "callback", | |
141 "optional": true, | |
142 "parameters": [] | |
143 } | |
144 ] | |
145 }, | |
146 { | |
147 "name": "getResourceIdentifiers", | |
148 "type": "function", | |
149 "description": "", | |
150 "parameters": [ | |
151 { | |
152 "name": "callback", | |
153 "type": "function", | |
154 "parameters": [ | |
155 { | |
156 "name": "resourceIdentifiers", | |
157 "type": "array", | |
158 "description": "A list of resource identifiers for this cont
ent type, or <var>undefined</var> if this content type does not use resource ide
ntifiers.", | |
159 "optional": true, | |
160 "items": { | |
161 "$ref": "ResourceIdentifier" | |
162 } | |
163 } | |
164 ] | |
165 } | |
166 ] | |
167 } | |
168 ] | |
169 } | |
170 ], | |
171 "properties": { | |
172 "cookies": { | |
173 "$ref": "ContentSetting", | |
174 "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>: Bl
ock cookies,<br><var>session_only</var>: Accept cookies only for the current ses
sion. <br>Default is <var>allow</var>.<br>The primary URL is the URL representin
g the cookie origin. The secondary URL is the URL of the top-level frame.", | |
175 "value": [ | |
176 "cookies", | |
177 {"type":"string", "enum": ["allow", "block", "session_only"]} | |
178 ] | |
179 }, | |
180 "images": { | |
181 "$ref": "ContentSetting", | |
182 "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 main-frame URL. The secondary URL is the URL of the
image.", | |
183 "value": [ | |
184 "images", | |
185 {"type":"string", "enum": ["allow", "block"]} | |
186 ] | |
187 }, | |
188 "javascript": { | |
189 "$ref": "ContentSetting", | |
190 "description": "Whether to run JavaScript. One of<br><var>allow</var>: R
un JavaScript,<br><var>block</var>: Don't run JavaScript. <br>Default is <var>al
low</var>.<br>The primary URL is the main-frame URL. The secondary URL is not us
ed.", | |
191 "value": [ | |
192 "javascript", | |
193 {"type":"string", "enum": ["allow", "block"]} | |
194 ] | |
195 }, | |
196 "plugins": { | |
197 "$ref": "ContentSetting", | |
198 "description": "Whether to run plug-ins. One of<br><var>allow</var>: Run
plug-ins automatically,<br><var>block</var>: Don't run plug-ins automatically.
<br>Default is <var>allow</var>.<br>The primary URL is the main-frame URL. The s
econdary URL is not used.", | |
199 "value": [ | |
200 "plugins", | |
201 {"type":"string", "enum": ["allow", "block"]} | |
202 ] | |
203 }, | |
204 "popups": { | |
205 "$ref": "ContentSetting", | |
206 "description": "Whether to allow sites to show pop-ups. One of<br><var>a
llow</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 main
-frame URL. The secondary URL is not used.", | |
207 "value": [ | |
208 "popups", | |
209 {"type":"string", "enum": ["allow", "block"]} | |
210 ] | |
211 }, | |
212 "notifications": { | |
213 "$ref": "ContentSetting", | |
214 "description": "Whether to allow sites to show desktop notifications. On
e of<br><var>allow</var>: Allow sites to show desktop notifications,<br><var>blo
ck</var>: Don't allow sites to show desktop notifications,<br><var>ask</var>: As
k when a site wants to show desktop notifications. <br>Default is <var>ask</var>
.<br>The primary URL is the main-frame URL. The secondary URL is not used.", | |
215 "value": [ | |
216 "notifications", | |
217 {"type":"string", "enum": ["allow", "block", "ask"]} | |
218 ] | |
219 } | |
220 } | |
221 } | |
222 ] | |
OLD | NEW |