| 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": "scriptBadge", | |
| 8 "description": "Use the <code>chrome.scriptBadge</code> API to control the b
ehaviour of the script badge.", | |
| 9 "functions": [ | |
| 10 { | |
| 11 "name": "setPopup", | |
| 12 "type": "function", | |
| 13 "description": "Sets the html document to be opened as a popup when the
user clicks on the script badge's icon.", | |
| 14 "parameters": [ | |
| 15 { | |
| 16 "name": "details", | |
| 17 "type": "object", | |
| 18 "properties": { | |
| 19 "tabId": {"type": "integer", "minimum": 0, "description": "The id
of the tab for which you want to modify the script badge."}, | |
| 20 "popup": { | |
| 21 "type": "string", | |
| 22 "description": "The html file to show in a popup. If set to the
empty string (''), no popup is shown." | |
| 23 } | |
| 24 } | |
| 25 } | |
| 26 ] | |
| 27 }, | |
| 28 { | |
| 29 "name": "getPopup", | |
| 30 "type": "function", | |
| 31 "description": "Gets the html document set as the popup for this script
badge.", | |
| 32 "parameters": [ | |
| 33 { | |
| 34 "name": "details", | |
| 35 "type": "object", | |
| 36 "properties": { | |
| 37 "tabId": { | |
| 38 "type": "integer", | |
| 39 "description": "Specify the tab to get the popup from." | |
| 40 } | |
| 41 } | |
| 42 }, | |
| 43 { | |
| 44 "type": "function", | |
| 45 "name": "callback", | |
| 46 "parameters": [ | |
| 47 { | |
| 48 "name": "result", | |
| 49 "type": "string" | |
| 50 } | |
| 51 ] | |
| 52 } | |
| 53 ] | |
| 54 }, | |
| 55 { | |
| 56 "name": "getAttention", | |
| 57 "type": "function", | |
| 58 | |
| 59 "description": "Brings the script badge to the attention of the user, im
ploring her to click. You should call this when you detect that you can do some
thing to a particular tab. Do not call this for every tab. That's tacky. If th
e user clicks on the badge, the activeTab APIs become available. If the extensio
n has already run on this tab, this call does nothing.", | |
| 60 | |
| 61 "parameters": [ | |
| 62 { | |
| 63 "name": "details", | |
| 64 "type": "object", | |
| 65 "properties": { | |
| 66 "tabId": { | |
| 67 "type": "integer", | |
| 68 "description": "Specify the tab to request to act on." | |
| 69 } | |
| 70 } | |
| 71 } | |
| 72 ] | |
| 73 } | |
| 74 ], | |
| 75 "events": [ | |
| 76 { | |
| 77 "name": "onClicked", | |
| 78 "type": "function", | |
| 79 "description": "Fired when a script badge icon is clicked. This event w
ill not fire if the script badge has a popup.", | |
| 80 "parameters": [ | |
| 81 { | |
| 82 "name": "tab", | |
| 83 "$ref": "tabs.Tab" | |
| 84 } | |
| 85 ] | |
| 86 } | |
| 87 ] | |
| 88 } | |
| 89 ] | |
| OLD | NEW |