summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/api/types.json
blob: 0ed842874b2f9267864be20bbd6190f4e057d7cc (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
// 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": "types",
    "description": "The <code>chrome.types</code> API contains type declarations for Chrome. Currently, this comprises only a prototype for giving other APIs access to manage Chrome browser settings. This prototype is used, for example, for $ref:proxy.settings.",
    "types": [
      {
        "id": "ChromeSetting",
        "type": "object",
        "js_module": "ChromeSetting",
        "customBindings": "ChromeSetting",
        "description": "An interface which allows access to a Chrome browser setting.",
        "functions": [
          {
            "name": "get",
            "type": "function",
            "description": "Gets the value of a setting.",
            "parameters": [
              {
                "name": "details",
                "type": "object",
                "description": "What setting to consider.",
                "properties": {
                  "incognito": {
                    "type": "boolean",
                    "optional": true,
                    "description": "Whether to return the setting that applies to the incognito session (default false)."
                  }
                }
              },
              {
                "name": "callback",
                "type": "function",
                "parameters": [
                  {
                    "name": "details",
                    "type": "object",
                    "description": "Details of the currently effective value.",
                    "properties": {
                      "value": {
                        "description": "The value of the setting.",
                        "type": "any"
                      },
                      "levelOfControl": {
                        "description": "One of<br><var>not_controllable</var>: cannot be controlled by any extension<br><var>controlled_by_other_extensions</var>: controlled by extensions with higher precedence<br><var>controllable_by_this_extension</var>: can be controlled by this extension<br><var>controlled_by_this_extension</var>: controlled by this extension",
                        "type": "string",
                        "enum": ["not_controllable", "controlled_by_other_extensions", "controllable_by_this_extension", "controlled_by_this_extension"]
                      },
                      "incognitoSpecific": {
                        "description": "Whether the effective value is specific to the incognito session.<br>This property will <em>only</em> be present if the <var>incognito</var> property in the <var>details</var> parameter of <code>get()</code> was true.",
                        "type": "boolean",
                        "optional": true
                      }
                    }
                  }
                ]
              }
            ]
          },
          {
            "name": "set",
            "type": "function",
            "description": "Sets the value of a setting.",
            "parameters": [
              {
                "name": "details",
                "type": "object",
                "description": "What setting to change.",
                "properties": {
                  "value": {
                    "description": "The value of the setting. <br>Note that every setting has a specific value type, which is described together with the setting. An extension should <em>not</em> set a value of a different type.",
                    "type": "any"
                  },
                  "scope": {
                    "type": "string",
                    "enum": ["regular", "regular_only", "incognito_persistent", "incognito_session_only"],
                    "optional": true,
                    "description": "Where to set the setting (default: regular). One of<br><var>regular</var>: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere),<br><var>regular_only</var>: setting for the regular profile only (not inherited by the incognito profile),<br><var>incognito_persistent</var>: setting for the incognito profile that survives browser restarts (overrides regular preferences),<br><var>incognito_session_only</var>: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences)."
                  }
                }
              },
              {
                "name": "callback",
                "type": "function",
                "description": "Called after the setting has been set.",
                "optional": true,
                "parameters": []
              }
            ]
          },
          {
            "name": "clear",
            "type": "function",
            "description": "Clears the setting. This way default settings can become effective again.",
            "parameters": [
              {
                "name": "details",
                "type": "object",
                "description": "What setting to clear.",
                "properties": {
                  "scope": {
                    "type": "string",
                    "enum": ["regular", "regular_only", "incognito_persistent", "incognito_session_only"],
                    "optional": true,
                    "description": "Where to clear the setting (default: regular). One of<br><var>regular</var>: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere),<br><var>regular_only</var>: setting for the regular profile only (not inherited by the incognito profile),<br><var>incognito_persistent</var>: setting for the incognito profile that survives browser restarts (overrides regular preferences),<br><var>incognito_session_only</var>: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences)."
                  }
                }
              },
              {
                "name": "callback",
                "type": "function",
                "description": "Called after the setting has been cleared.",
                "optional": true,
                "parameters": []
              }
            ]
          }
        ],
        "events": [
          {
            "name": "onChange",
            "description": "Fired when the value of the setting changes.",
            "parameters": [
              {
                "type": "object",
                "name": "details",
                "properties": {
                  "value": {
                    "description": "The value of the setting.",
                    "type": "any"
                  },
                  "levelOfControl": {
                    "description": "One of<br><var>not_controllable</var>: cannot be controlled by any extension<br><var>controlled_by_other_extensions</var>: controlled by extensions with higher precedence<br><var>controllable_by_this_extension</var>: can be controlled by this extension<br><var>controlled_by_this_extension</var>: controlled by this extension",
                    "type": "string",
                    "enum": ["not_controllable", "controlled_by_other_extensions", "controllable_by_this_extension", "controlled_by_this_extension"]
                  },
                  "incognitoSpecific": {
                    "description": "Whether the value that has changed is specific to the incognito session.<br>This property will <em>only</em> be present if the user has enabled the extension in incognito mode.",
                    "type": "boolean",
                    "optional": true
                  }
                }
              }
            ]
          }
        ]
      }
    ]
  }
]