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.
7 "namespace": "browserAction",
8 "description": "Use browser actions to put icons in the main Google Chrome toolbar, to the right of the address bar. In addition to its <a href='browserAction#icon'>icon</a>, a browser action can also have a <a href='browserAction#tooltip'>tooltip</a>, a <a href='browserAction#badge'>badge</a>, and a <a href='browserAction#popups'>popup</a>.",
22 "id": "ImageDataType",
24 "isInstanceOf": "ImageData",
25 "additionalProperties": { "type": "any" },
26 "description": "Pixel data for an image. Must be an ImageData object (for example, from a <code>canvas</code> element)."
33 "description": "Sets the title of the browser action. This shows up in the tooltip.",
41 "description": "The string the browser action should display when moused over."
46 "description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."
55 "description": "Gets the title of the browser action.",
64 "description": "Specify the tab to get the title from. If no tab is specified, the non-tab-specific title is returned."
83 "description": "Sets the icon for the browser action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the <b>path</b> or the <b>imageData</b> property must be specified.",
91 { "$ref": "ImageDataType" },
95 "19": {"$ref": "ImageDataType", "optional": true},
96 "38": {"$ref": "ImageDataType", "optional": true}
101 "description": "Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'"
105 { "type": "string" },
109 "19": {"type": "string", "optional": true},
110 "38": {"type": "string", "optional": true}
115 "description": "Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'"
120 "description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."
135 "description": "Sets the html document to be opened as a popup when the user clicks on the browser action's icon.",
145 "description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."
149 "description": "The html file to show in a popup. If set to the empty string (''), no popup is shown."
158 "description": "Gets the html document set as the popup for this browser action.",
167 "description": "Specify the tab to get the popup from. If no tab is specified, the non-tab-specific popup is returned."
184 "name": "setBadgeText",
186 "description": "Sets the badge text for the browser action. The badge is displayed on top of the icon.",
194 "description": "Any number of characters can be passed, but only about four can fit in the space."
199 "description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."
206 "name": "getBadgeText",
208 "description": "Gets the badge text of the browser action. If no tab is specified, the non-tab-specific badge text is returned.",
217 "description": "Specify the tab to get the badge text from. If no tab is specified, the non-tab-specific badge text is returned."
234 "name": "setBadgeBackgroundColor",
236 "description": "Sets the background color for the badge.",
243 "description": "An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is <code>[255, 0, 0, 255]</code>. Can also be a string with a CSS value, with opaque red being <code>#FF0000</code> or <code>#F00</code>.",
246 {"$ref": "ColorArray"}
252 "description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."
259 "name": "getBadgeBackgroundColor",
261 "description": "Gets the background color of the browser action.",
270 "description": "Specify the tab to get the badge background color from. If no tab is specified, the non-tab-specific badge background color is returned."
289 "description": "Enables the browser action for a tab. By default, browser actions are enabled.",
296 "description": "The id of the tab for which you want to modify the browser action."
303 "description": "Disables the browser action for a tab.",
310 "description": "The id of the tab for which you want to modify the browser action."
317 "description": "Opens the extension popup window in the active window but does not grant tab permissions.",
328 "description": "JavaScript 'window' object for the popup window if it was succesfully opened.",
329 "additionalProperties": { "type": "any" }
340 "description": "Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup.",