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 "types": [ | |
9 { | |
10 "id": "ResourceIdentifier", | |
11 "type": "object", | |
12 "properties": { | |
13 "id": { | |
14 "type": "string", | |
15 "description": "The resource identifier for the given content type." | |
16 }, | |
17 "description": { | |
18 "type": "string", | |
19 "optional": true, | |
20 "description": "A human readable description of the resource." | |
21 } | |
22 }, | |
23 "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>." | |
24 }, | |
25 { | |
26 "id": "ContentSetting", | |
27 "type": "object", | |
28 "functions": [ | |
29 { | |
30 "name": "clear", | |
31 "type": "function", | |
32 "description": "Clear all content setting rules set by this extensio
n.", | |
33 "parameters": [ | |
34 { | |
35 "name": "details", | |
36 "type": "object", | |
37 "properties": { | |
38 "scope": { | |
39 "type": "string", | |
40 "enum": ["regular", "incognito_session_only"], | |
41 "optional": true, | |
42 "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)." | |
43 } | |
44 } | |
45 }, | |
46 { | |
47 "type": "function", | |
48 "name": "callback", | |
49 "optional": true, | |
50 "parameters": [] | |
51 } | |
52 ] | |
53 }, | |
54 { | |
55 "name": "get", | |
56 "type": "function", | |
57 "description": "Gets the current content setting for a given pair of
URLs.", | |
58 "parameters": [ | |
59 { | |
60 "name": "details", | |
61 "type": "object", | |
62 "properties": { | |
63 "primaryUrl": { | |
64 "type": "string", | |
65 "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." | |
66 }, | |
67 "secondaryUrl": { | |
68 "type": "string", | |
69 "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.", | |
70 "optional": true | |
71 }, | |
72 "resourceIdentifier": { | |
73 "$ref": "ResourceIdentifier", | |
74 "optional": true, | |
75 "description": "A more specific identifier of the type of co
ntent for which the settings should be retrieved." | |
76 }, | |
77 "incognito": { | |
78 "type": "boolean", | |
79 "optional": true, | |
80 "description": "Whether to check the content settings for an
incognito session. (default false)" | |
81 } | |
82 } | |
83 }, | |
84 { | |
85 "type": "function", | |
86 "name": "callback", | |
87 "parameters": [ | |
88 { | |
89 "name": "details", | |
90 "type": "object", | |
91 "properties": { | |
92 "setting": { | |
93 "type": "any", | |
94 "description": "The content setting. See the description
of the individual ContentSetting objects for the possible values." | |
95 } | |
96 } | |
97 } | |
98 ] | |
99 } | |
100 ] | |
101 }, | |
102 { | |
103 "name": "set", | |
104 "type": "function", | |
105 "description": "Applies a new content setting rule.", | |
106 "parameters": [ | |
107 { | |
108 "name": "details", | |
109 "type": "object", | |
110 "properties": { | |
111 "primaryPattern": { | |
112 "type": "string", | |
113 "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>." | |
114 }, | |
115 "secondaryPattern": { | |
116 "type": "string", | |
117 "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>.", | |
118 "optional": true | |
119 }, | |
120 "resourceIdentifier": { | |
121 "$ref": "ResourceIdentifier", | |
122 "optional": true, | |
123 "description": "The resource identifier for the content type
." | |
124 }, | |
125 "setting": { | |
126 "type": "any", | |
127 "description": "The setting applied by this rule. See the de
scription of the individual ContentSetting objects for the possible values." | |
128 }, | |
129 "scope": { | |
130 "type": "string", | |
131 "enum": ["regular", "incognito_session_only"], | |
132 "optional": true, | |
133 "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)." | |
134 } | |
135 } | |
136 }, | |
137 { | |
138 "type": "function", | |
139 "name": "callback", | |
140 "optional": true, | |
141 "parameters": [] | |
142 } | |
143 ] | |
144 }, | |
145 { | |
146 "name": "getResourceIdentifiers", | |
147 "type": "function", | |
148 "description": "", | |
149 "parameters": [ | |
150 { | |
151 "name": "callback", | |
152 "type": "function", | |
153 "parameters": [ | |
154 { | |
155 "name": "resourceIdentifiers", | |
156 "type": "array", | |
157 "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.", | |
158 "optional": true, | |
159 "items": { | |
160 "$ref": "ResourceIdentifier" | |
161 } | |
162 } | |
163 ] | |
164 } | |
165 ] | |
166 } | |
167 ] | |
168 } | |
169 ], | |
170 "properties": { | |
171 "cookies": { | |
172 "$ref": "ContentSetting", | |
173 "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.", | |
174 "value": [ | |
175 "cookies", | |
176 {"type":"string", "enum": ["allow", "block", "session_only"]} | |
177 ] | |
178 }, | |
179 "images": { | |
180 "$ref": "ContentSetting", | |
181 "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.", | |
182 "value": [ | |
183 "images", | |
184 {"type":"string", "enum": ["allow", "block"]} | |
185 ] | |
186 }, | |
187 "javascript": { | |
188 "$ref": "ContentSetting", | |
189 "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.", | |
190 "value": [ | |
191 "javascript", | |
192 {"type":"string", "enum": ["allow", "block"]} | |
193 ] | |
194 }, | |
195 "plugins": { | |
196 "$ref": "ContentSetting", | |
197 "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.", | |
198 "value": [ | |
199 "plugins", | |
200 {"type":"string", "enum": ["allow", "block"]} | |
201 ] | |
202 }, | |
203 "popups": { | |
204 "$ref": "ContentSetting", | |
205 "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.", | |
206 "value": [ | |
207 "popups", | |
208 {"type":"string", "enum": ["allow", "block"]} | |
209 ] | |
210 }, | |
211 "notifications": { | |
212 "$ref": "ContentSetting", | |
213 "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.", | |
214 "value": [ | |
215 "notifications", | |
216 {"type":"string", "enum": ["allow", "block", "ask"]} | |
217 ] | |
218 } | |
219 } | |
220 } | |
221 ] | |
OLD | NEW |