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": "pageAction", | |
8 "dependencies": [ "tabs" ], | |
9 "types": [], | |
10 "functions": [ | |
11 { | |
12 "name": "show", | |
13 "type": "function", | |
14 "description": "Shows the page action. The page action is shown whenever
the tab is selected.", | |
15 "parameters": [ | |
16 {"type": "integer", "name": "tabId", "minimum": 0, "description": "The
id of the tab for which you want to modify the page action."} | |
17 ] | |
18 }, | |
19 { | |
20 "name": "hide", | |
21 "type": "function", | |
22 "description": "Hides the page action.", | |
23 "parameters": [ | |
24 {"type": "integer", "name": "tabId", "minimum": 0, "description": "The
id of the tab for which you want to modify the page action."} | |
25 ] | |
26 }, | |
27 { | |
28 "name": "setTitle", | |
29 "type": "function", | |
30 "description": "Sets the title of the page action. This is displayed in
a tooltip over the page action.", | |
31 "parameters": [ | |
32 { | |
33 "name": "details", | |
34 "type": "object", | |
35 "properties": { | |
36 "tabId": {"type": "integer", "minimum": 0, "description": "The id
of the tab for which you want to modify the page action."}, | |
37 "title": {"type": "string", "description": "The tooltip string."} | |
38 } | |
39 } | |
40 ] | |
41 }, | |
42 { | |
43 "name": "getTitle", | |
44 "type": "function", | |
45 "description": "Gets the title of the browser action.", | |
46 "parameters": [ | |
47 { | |
48 "name": "details", | |
49 "type": "object", | |
50 "properties": { | |
51 "tabId": { | |
52 "type": "integer", | |
53 "description": "Specify the tab to get the title from." | |
54 } | |
55 } | |
56 }, | |
57 { | |
58 "type": "function", | |
59 "name": "callback", | |
60 "parameters": [ | |
61 { | |
62 "name": "result", | |
63 "type": "string" | |
64 } | |
65 ] | |
66 } | |
67 ] | |
68 }, | |
69 { | |
70 "name": "setIcon", | |
71 "type": "function", | |
72 "description": "Sets the icon for the page action. The icon can be speci
fied either as the path to an image file or as the pixel data from a canvas elem
ent. Either the <b>path</b> or the <b>imageData</b> property must be specified."
, | |
73 "parameters": [ | |
74 { | |
75 "name": "details", | |
76 "type": "object", | |
77 "properties": { | |
78 "tabId": {"type": "integer", "minimum": 0, "description": "The id
of the tab for which you want to modify the page action."}, | |
79 "imageData": { | |
80 "type": "object", | |
81 "isInstanceOf": "ImageData", | |
82 "additionalProperties": { "type": "any" }, | |
83 "description": "Pixel data for an image. Must be an ImageData ob
ject (for example, from a canvas element).", | |
84 "optional": true | |
85 }, | |
86 "path": { | |
87 "type": "string", | |
88 "description": "Relative path to an image in the extension to sh
ow in the browser action.", | |
89 "optional": true | |
90 }, | |
91 "iconIndex": { | |
92 "type": "integer", | |
93 "minimum": 0, | |
94 "description": "<b>Deprecated.</b> The zero-based index into the
<b>icons</b> vector specified in the manifest.", | |
95 "optional": true | |
96 } | |
97 } | |
98 } | |
99 ] | |
100 }, | |
101 { | |
102 "name": "setPopup", | |
103 "type": "function", | |
104 "description": "Sets the html document to be opened as a popup when the
user clicks on the page action's icon.", | |
105 "parameters": [ | |
106 { | |
107 "name": "details", | |
108 "type": "object", | |
109 "properties": { | |
110 "tabId": {"type": "integer", "minimum": 0, "description": "The id
of the tab for which you want to modify the page action."}, | |
111 "popup": { | |
112 "type": "string", | |
113 "description": "The html file to show in a popup. If set to the
empty string (''), no popup is shown." | |
114 } | |
115 } | |
116 } | |
117 ] | |
118 }, | |
119 { | |
120 "name": "getPopup", | |
121 "type": "function", | |
122 "description": "Gets the html document set as the popup for this browser
action.", | |
123 "parameters": [ | |
124 { | |
125 "name": "details", | |
126 "type": "object", | |
127 "properties": { | |
128 "tabId": { | |
129 "type": "integer", | |
130 "description": "Specify the tab to get the popup from." | |
131 } | |
132 } | |
133 }, | |
134 { | |
135 "type": "function", | |
136 "name": "callback", | |
137 "parameters": [ | |
138 { | |
139 "name": "result", | |
140 "type": "string" | |
141 } | |
142 ] | |
143 } | |
144 ] | |
145 } | |
146 ], | |
147 "events": [ | |
148 { | |
149 "name": "onClicked", | |
150 "type": "function", | |
151 "description": "Fired when a page action icon is clicked. This event wi
ll not fire if the page action has a popup.", | |
152 "parameters": [ | |
153 { | |
154 "name": "tab", | |
155 "$ref": "tabs.Tab" | |
156 } | |
157 ] | |
158 } | |
159 ] | |
160 } | |
161 ] | |
OLD | NEW |