- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / common / extensions / api / page_actions.json
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": "pageActions",
8     "description": "none",
9     "maximumManifestVersion": 1,
10     "functions": [
11       {
12         "name": "enableForTab",
13         "type": "function",
14         "description": "Enables a page action for a particular tab+URL combination (makes its icon visible in the OmniBox when a certain URL is active in a given tab). The page action will automatically be disabled (its icon hidden) if the user navigates to a new URL or closes the tab. The action will also automatically be enabled/disabled as the user switches tabs.",
15         "parameters": [
16           {"type": "string", "name": "pageActionId", "description": "An extension can have multiple page actions specified in the manifest, each with a unique identifier. This string identifies which page action you want to enable (and must match a page action id declared in the manifest)."},
17           {
18             "type": "object",
19             "name": "action",
20             "description": "An object specifing what action should be applied to the page action. Contains the following properties:",
21             "properties": {
22               "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to enable the page action."},
23               "url": {"type": "string", "description": "The URL of the page you want the page action to apply to. If the URL specified does not match the currently navigated URL (user has navigated to another page) then no action is taken."},
24               "title": {"type": "string", "optional": true, "description": "Specifying <b>title</b> allows you to change the tooltip that appears when you hover over the page action icon in the OmniBox. This parameter is optional and if omitted then the page action <b>name</b> property declared in the manifest is used."},
25               "iconId": {"type": "integer", "minimum": 0, "optional": true, "description": "A zero-based index into the <b>icons</b> vector specified in the manifest. This parameter is optional and if omitted then the first icon in the <b>icons</b> vector of the page action is used. This id is useful to represent different page action states. Example: An RSS feed icon could have a 'subscribe now' icon and an 'already subscribed' icon."}
26             },
27             "optional": false
28           }
29         ]
30       },
31       {
32         "name": "disableForTab",
33         "type": "function",
34         "description": "Disables a page action for a particular tab+URL combination (makes its OmniBox page action icon hidden when a certain URL is active in a given tab). This can be useful to disable a page action before the user navigates away from a page containing an enabled page action.",
35         "parameters": [
36           {"type": "string", "name": "pageActionId", "description": "An extension can have multiple page actions specified in the manifest, each with a unique identifier. This string identifies which page action you want to disable (and must match a page action id declared in the manifest)."},
37           {
38             "type": "object",
39             "name": "action",
40             "description": "An object specifying what action should be applied to the page action. Contains the following properties:",
41             "properties": {
42               "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to disable the page action."},
43               "url": {"type": "string", "description": "The URL of the page you want the page action to not apply to. If the URL specified does not match the currently navigated URL (user has navigated to another page) then no action is taken."}
44             },
45             "optional": false
46           }
47         ]
48       }
49     ],
50     "events": []
51   }
52 ]