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": "pageAction",
8 "description": "Use the <code>chrome.pageAction</code> API to put icons inside the address bar. Page actions represent actions that can be taken on the current page, but that aren't applicable to all pages.",
11 "id": "ImageDataType",
13 "isInstanceOf": "ImageData",
14 "additionalProperties": { "type": "any" },
15 "description": "Pixel data for an image. Must be an ImageData object (for example, from a <code>canvas</code> element)."
22 "description": "Shows the page action. The page action is shown whenever the tab is selected.",
24 {"type": "integer", "name": "tabId", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."}
30 "description": "Hides the page action.",
32 {"type": "integer", "name": "tabId", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."}
38 "description": "Sets the title of the page action. This is displayed in a tooltip over the page action.",
44 "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
45 "title": {"type": "string", "description": "The tooltip string."}
53 "description": "Gets the title of the page action.",
61 "description": "Specify the tab to get the title from."
80 "description": "Sets the icon for the page 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.",
86 "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
89 { "$ref": "ImageDataType" },
93 "19": {"$ref": "ImageDataType", "optional": true},
94 "38": {"$ref": "ImageDataType", "optional": true}
99 "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}'"
103 { "type": "string" },
107 "19": {"type": "string", "optional": true},
108 "38": {"type": "string", "optional": true}
113 "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}'"
118 "description": "<b>Deprecated.</b> This argument is ignored.",
134 "description": "Sets the html document to be opened as a popup when the user clicks on the page action's icon.",
140 "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
143 "description": "The html file to show in a popup. If set to the empty string (''), no popup is shown."
152 "description": "Gets the html document set as the popup for this page action.",
160 "description": "Specify the tab to get the popup from."
181 "description": "Fired when a page action icon is clicked. This event will not fire if the page action has a popup.",