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": "sessions", |
| 8 "description": "Use the <code>chrome.sessions</code> API to query and restor
e tabs and windows from a browsing session.", |
| 9 "types": [ |
| 10 { |
| 11 "id": "Session", |
| 12 "type": "object", |
| 13 "properties": { |
| 14 "lastModified": {"type": "integer", "description": "The time when the
window or tab was closed, represented in milliseconds since the epoch"}, |
| 15 "tab": {"$ref": "tabs.Tab", "optional": true, "description": "The clos
ed $ref:tabs.Tab, if this entry describes a tab. Either this or $ref:Session.win
dow will be set."}, |
| 16 "window": {"$ref": "windows.Window", "optional": true, "description":
"The closed $ref:windows.Window, if this entry describes a window. Either this o
r $ref:Session.tab will be set."} |
| 17 } |
| 18 }, |
| 19 { |
| 20 "id": "Device", |
| 21 "type": "object", |
| 22 "properties": { |
| 23 "info": {"type": "string", "description": "Represents all information
about device."}, |
| 24 "sessions": {"type": "array", "items": {"$ref": "Session"}, "descripti
on": "Each session represents a window and its currently open tabs on said devic
e. The array will comprise of all window entries currently open on related devic
e."} |
| 25 } |
| 26 } |
| 27 ], |
| 28 "functions": [ |
| 29 { |
| 30 "name": "getRecentlyClosed", |
| 31 "type": "function", |
| 32 "description": "Gets the list of recently closed tabs and/or windows.", |
| 33 "parameters": [ |
| 34 { |
| 35 "type": "object", |
| 36 "name": "options", |
| 37 "optional": true, |
| 38 "properties": { |
| 39 "maxResults": { |
| 40 "type": "integer", |
| 41 "minimum": 0, |
| 42 "maximum": 25, |
| 43 "optional": true, |
| 44 "description": "The maximum number of entries to be fetched in t
he requested list. Omit to fetch the maximum number of entries (25)." |
| 45 }, |
| 46 "entryType": { |
| 47 "type": "string", |
| 48 "enum": ["tab", "window"], |
| 49 "optional": true, |
| 50 "description": "The type of entry to fetch. Omit to fetch all ty
pes of entries." |
| 51 } |
| 52 } |
| 53 }, |
| 54 { |
| 55 "type": "function", |
| 56 "name": "callback", |
| 57 "parameters": [ |
| 58 { |
| 59 "name": "sessions", "type": "array", "items": { "$ref": "Session
" }, "description": "The list of closed entries in reverse order that they were
closed (the most recently closed tab or window will be at index <code>0</code>).
If <code>entryType</code> is specified the entries will be only of that type, o
therwise the entries may contain either tabs or windows.List of $ref:Session rep
resenting the closed tab/window for the session." |
| 60 } |
| 61 ] |
| 62 } |
| 63 ] |
| 64 }, |
| 65 { |
| 66 "name": "getDevices", |
| 67 "type": "function", |
| 68 "description": "Retrieves all synced sessions and returns in sorted orde
r from device with most recently modified session to device with least recently
modified session, and within each device by most recent to least recently modifi
ed session.", |
| 69 "parameters": [ |
| 70 { |
| 71 "name": "maxResults", |
| 72 "type": "integer", |
| 73 "optional": true, |
| 74 "minimum": 0, |
| 75 "maximum": 10 |
| 76 }, |
| 77 { |
| 78 "type": "function", |
| 79 "name": "callback", |
| 80 "parameters": [ |
| 81 { |
| 82 "name": "devices", "type": "array", "items": { "$ref": "Device"
}, "description": "The list of $ref:Device objects for each synced session, sort
ed in order from device with most recently modified session to device with least
recently modified session, and within each device by most recent to least recen
tly modified session." |
| 83 } |
| 84 ] |
| 85 } |
| 86 ] |
| 87 }, |
| 88 { |
| 89 "name": "restore", |
| 90 "type": "function", |
| 91 "description": "Reopens a $ref:Session, $ref:windows.Window, or $ref:tab
s.Tab, with an optional callback to run when the entry has been restored.", |
| 92 "parameters": [ |
| 93 { |
| 94 "type": "string", |
| 95 "name": "sessionId", |
| 96 "optional": true, |
| 97 "description": "The API provided $ref:windows.Window.sessionId, or $
ref:tabs.Tab.sessionId to restore." |
| 98 }, |
| 99 { |
| 100 "type": "function", |
| 101 "name": "callback", |
| 102 "optional": true, |
| 103 "parameters": [ |
| 104 { |
| 105 "choices": [{"$ref": "windows.Window"}, {"$ref": "tabs.Tab"}], |
| 106 "name": "restoredSession", |
| 107 "description": "The restored $ref:windows.Window or $ref:tabs.Ta
b object." |
| 108 } |
| 109 ] |
| 110 } |
| 111 ] |
| 112 } |
| 113 ] |
| 114 } |
| 115 ] |
OLD | NEW |