summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/api/content_settings.json
blob: 2a0b86a1d1bbce67998150aecff73ef5f928a202 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

[
  {
    "namespace": "contentSettings",
    "description": "Use the <code>chrome.contentSettings</code> API to change settings that control whether websites can use features such as cookies, JavaScript, and plug-ins. More generally speaking, content settings allow you to customize Chrome's behavior on a per-site basis instead of globally.",
    "compiler_options": {
      "generate_type_functions": true
    },
    "types": [
      {
        "id": "ResourceIdentifier",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The resource identifier for the given content type."
          },
          "description": {
            "type": "string",
            "optional": true,
            "description": "A human readable description of the resource."
          }
        },
        "description": "The only content type using resource identifiers is $ref:contentSettings.plugins. For more information, see <a href=\"contentSettings.html#resource-identifiers\">Resource Identifiers</a>."
      },
      {
        "id": "ContentSetting",
        "js_module": "ContentSetting",
        "type": "object",
        "functions": [
          {
            "name": "clear",
            "type": "function",
            "description": "Clear all content setting rules set by this extension.",
            "parameters": [
              {
                "name": "details",
                "type": "object",
                "properties": {
                  "scope": {
                    "type": "string",
                    "enum": ["regular", "incognito_session_only"],
                    "optional": true,
                    "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_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)."
                  }
                }
              },
              {
                "type": "function",
                "name": "callback",
                "optional": true,
                "parameters": []
              }
            ]
          },
          {
            "name": "get",
            "type": "function",
            "description": "Gets the current content setting for a given pair of URLs.",
            "parameters": [
              {
                "name": "details",
                "type": "object",
                "properties": {
                  "primaryUrl": {
                    "type": "string",
                    "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."
                  },
                  "secondaryUrl": {
                    "type": "string",
                    "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.",
                    "optional": true
                  },
                  "resourceIdentifier": {
                    "$ref": "ResourceIdentifier",
                    "optional": true,
                    "description": "A more specific identifier of the type of content for which the settings should be retrieved."
                  },
                  "incognito": {
                    "type": "boolean",
                    "optional": true,
                    "description": "Whether to check the content settings for an incognito session. (default false)"
                  }
                }
              },
              {
                "type": "function",
                "name": "callback",
                "parameters": [
                  {
                    "name": "details",
                    "type": "object",
                    "properties": {
                      "setting": {
                        "type": "any",
                        "description": "The content setting. See the description of the individual ContentSetting objects for the possible values."
                      }
                    }
                  }
                ]
              }
            ]
          },
          {
            "name": "set",
            "type": "function",
            "description": "Applies a new content setting rule.",
            "parameters": [
              {
                "name": "details",
                "type": "object",
                "properties": {
                  "primaryPattern": {
                    "type": "string",
                    "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>."
                  },
                  "secondaryPattern": {
                    "type": "string",
                    "description": "The pattern for the secondary URL. Defaults to matching all URLs. For details on the format of a pattern, see <a href='contentSettings.html#patterns'>Content Setting Patterns</a>.",
                    "optional": true
                  },
                  "resourceIdentifier": {
                    "$ref": "ResourceIdentifier",
                    "optional": true,
                    "description": "The resource identifier for the content type."
                  },
                  "setting": {
                    "type": "any",
                    "description": "The setting applied by this rule. See the description of the individual ContentSetting objects for the possible values."
                  },
                  "scope": {
                    "type": "string",
                    "enum": ["regular", "incognito_session_only"],
                    "optional": true,
                    "description": "Where to set 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_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)."
                  }
                }
              },
              {
                "type": "function",
                "name": "callback",
                "optional": true,
                "parameters": []
              }
            ]
          },
          {
            "name": "getResourceIdentifiers",
            "type": "function",
            "description": "",
            "parameters": [
              {
                "name": "callback",
                "type": "function",
                "parameters": [
                  {
                    "name": "resourceIdentifiers",
                    "type": "array",
                    "description": "A list of resource identifiers for this content type, or <var>undefined</var> if this content type does not use resource identifiers.",
                    "optional": true,
                    "items": {
                      "$ref": "ResourceIdentifier"
                    }
                  }
                ]
              }
            ]
          }
        ]
      }
    ],
    "properties": {
      "cookies": {
        "$ref": "ContentSetting",
        "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.",
        "value": [
          "cookies",
          {"type":"string", "enum": ["allow", "block", "session_only"]}
        ]
      },
      "images": {
        "$ref": "ContentSetting",
        "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.",
        "value": [
          "images",
          {"type":"string", "enum": ["allow", "block"]}
        ]
      },
      "javascript": {
        "$ref": "ContentSetting",
        "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 main-frame URL. The secondary URL is not used.",
        "value": [
          "javascript",
          {"type":"string", "enum": ["allow", "block"]}
        ]
      },
      "plugins": {
        "$ref": "ContentSetting",
        "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 secondary URL is not used.",
        "value": [
          "plugins",
          {"type":"string", "enum": ["allow", "block"]}
        ]
      },
      "popups": {
        "$ref": "ContentSetting",
        "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 main-frame URL. The secondary URL is not used.",
        "value": [
          "popups",
          {"type":"string", "enum": ["allow", "block"]}
        ]
      },
      "notifications": {
        "$ref": "ContentSetting",
        "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 main-frame URL. The secondary URL is not used.",
        "value": [
          "notifications",
          {"type":"string", "enum": ["allow", "block", "ask"]}
        ]
      }
    }
  }
]