1// Copyright 2014 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// The type schemas for structured manifest items. Not actually a callable API.
6
7[
8  {
9    "namespace": "extensionsManifestTypes",
10    "description": "Schemas for structured manifest entries",
11    "compiler_options": {
12      "generate_error_messages": true
13    },
14    "types": [
15      {
16        "id": "ExternallyConnectable",
17        "type": "object",
18        // Note: description commented out because externally_connectable.html
19        // already describes it, and the repetition looks odd.
20        // "description": "The <code>externally_connectable</code> manifest property declares which extensions, apps, and web pages can connect to your extension via $(ref:runtime.connect) and $(ref:runtime.sendMessage).",
21        "properties": {
22          "ids": {
23            "description": "<p>The IDs of extensions or apps that are allowed to connect. If left empty or unspecified, no extensions or apps can connect.</p><p>The wildcard <code>\"*\"</code> will allow all extensions and apps to connect.</p>",
24            "optional": true,
25            "type": "array",
26            "items": {"type": "string"}
27          },
28          "matches": {
29            "description": "<p>The URL patterns for <em>web pages</em> that are allowed to connect. <em>This does not affect content scripts.</em> If left empty or unspecified, no web pages can connect.</p><p>Patterns cannot include wildcard domains nor subdomains of <a href=\"http://publicsuffix.org/list/\">(effective) top level domains</a>; <code>*://google.com/*</code> and <code>http://*.chromium.org/*</code> are valid, while <code>&lt;all_urls&gt;</code>, <code>http://*/*</code>, <code>*://*.com/*</code>, and even <code>http://*.appspot.com/*</code> are not.</p>",
30            "optional": true,
31            "type": "array",
32            "items": {"type": "string"}
33          },
34          "accepts_tls_channel_id": {
35            "description": "If <code>true</code>, messages sent via $(ref:runtime.connect) or $(ref:runtime.sendMessage) will set $(ref:runtime.MessageSender.tlsChannelId) if those methods request it to be. If <code>false</code>, $(ref:runtime.MessageSender.tlsChannelId) will never be set under any circumstance.",
36            "optional": true,
37            "type": "boolean"
38          }
39        }
40      },
41      {
42        "id": "OptionsUI",
43        "type": "object",
44        "description": "The <code>options_ui</code> manifest property declares how the options page should be displayed.",
45        "properties": {
46          "page": {
47            "description": "The path to your options page.",
48            "type": "string"
49          },
50          "chrome_style": {
51            "description": "If <code>true</code>, a Chrome user agent stylesheet will be applied to your options page. The default value is <code>false</code>.",
52            "optional": true,
53            "type": "boolean"
54          },
55          "open_in_tab": {
56            "description": "If <code>true</code>, the options page will be opened in a new tab instead of in an embedded popup in chrome://extensions. The default value is <code>false</code>.",
57            "optional": true,
58            "type": "boolean"
59          }
60        }
61      },
62      {
63        "id": "SocketHostPatterns",
64        "description": "<p>A single string or a list of strings representing host:port patterns.</p>",
65        "choices": [
66          { "type": "string" },
67          { "type": "array", "items": { "type": "string" } }
68        ]
69      },
70      {
71        "id": "sockets",
72        "type": "object",
73        "description": "The <code>sockets</code> manifest property declares which sockets operations an app can issue.",
74        "properties": {
75          "udp": {
76            "description": "The <code>udp</code> manifest property declares which sockets.udp operations an app can issue.",
77            "optional": true,
78            "type": "object",
79            "properties": {
80              "bind": {
81                "description": "<p>The host:port pattern for <code>bind</code> operations.</p>",
82                "optional": true,
83                "$ref": "SocketHostPatterns"
84              },
85              "send": {
86                "description": "<p>The host:port pattern for <code>send</code> operations.</p>",
87                "optional": true,
88                "$ref": "SocketHostPatterns"
89              },
90              "multicastMembership": {
91                "description": "<p>The host:port pattern for <code>joinGroup</code> operations.</p>",
92                "optional": true,
93                "$ref": "SocketHostPatterns"
94              }
95            }
96          },
97          "tcp": {
98            "description": "The <code>tcp</code> manifest property declares which sockets.tcp operations an app can issue.",
99            "optional": true,
100            "type": "object",
101            "properties": {
102              "connect": {
103                "description": "<p>The host:port pattern for <code>connect</code> operations.</p>",
104                "optional": true,
105                "$ref": "SocketHostPatterns"
106              }
107            }
108          },
109          "tcpServer": {
110            "description": "The <code>tcpServer</code> manifest property declares which sockets.tcpServer operations an app can issue.",
111            "optional": true,
112            "type": "object",
113            "properties": {
114              "listen": {
115                "description": "<p>The host:port pattern for <code>listen</code> operations.</p>",
116                "optional": true,
117                "$ref": "SocketHostPatterns"
118              }
119            }
120          }
121        }
122      },
123      {
124        "id": "bluetooth",
125        "type": "object",
126        "description": "The <code>bluetooth</code> manifest property give permission to an app to use the $(ref:bluetooth) API. A list of UUIDs can be optionally specified to enable communication with devices.",
127        "properties": {
128          "uuids": {
129            "description": "The <code>uuids</code> manifest property declares the list of protocols, profiles and services that an app can communicate using.",
130            "optional": true,
131            "type": "array",
132            "items": {
133              "description": "<p>The list specified as UUID strings.</p>",
134              "type": "string"
135            }
136          },
137          "socket": {
138            "type": "boolean",
139            "description": "If <code>true</code>, gives permission to an app to use the $(ref:bluetoothSocket) API",
140            "optional": true
141          },
142          "low_energy": {
143            "type": "boolean",
144            "description": "If <code>true</code>, gives permission to an app to use the $(ref:bluetoothLowEnergy) API",
145            "optional": true
146          }
147        }
148      }
149    ]
150  }
151]
152