| 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": "cookies", |
| 8 "types": [ |
| 9 { |
| 10 "id": "Cookie", |
| 11 "type": "object", |
| 12 "description": "Represents information about an HTTP cookie.", |
| 13 "properties": { |
| 14 "name": {"type": "string", "description": "The name of the cookie."}, |
| 15 "value": {"type": "string", "description": "The value of the cookie."}
, |
| 16 "domain": {"type": "string", "description": "The domain of the cookie
(e.g. \"www.google.com\", \"example.com\")."}, |
| 17 "hostOnly": {"type": "boolean", "description": "True if the cookie is
a host-only cookie (i.e. a request's host must exactly match the domain of the c
ookie)."}, |
| 18 "path": {"type": "string", "description": "The path of the cookie."}, |
| 19 "secure": {"type": "boolean", "description": "True if the cookie is ma
rked as Secure (i.e. its scope is limited to secure channels, typically HTTPS)."
}, |
| 20 "httpOnly": {"type": "boolean", "description": "True if the cookie is
marked as HttpOnly (i.e. the cookie is inaccessible to client-side scripts)."}, |
| 21 "session": {"type": "boolean", "description": "True if the cookie is a
session cookie, as opposed to a persistent cookie with an expiration date."}, |
| 22 "expirationDate": {"type": "number", "optional": true, "description":
"The expiration date of the cookie as the number of seconds since the UNIX epoch
. Not provided for session cookies."}, |
| 23 "storeId": {"type": "string", "description": "The ID of the cookie sto
re containing this cookie, as provided in getAllCookieStores()."} |
| 24 } |
| 25 }, |
| 26 { |
| 27 "id": "CookieStore", |
| 28 "type": "object", |
| 29 "description": "Represents a cookie store in the browser. An incognito m
ode window, for instance, uses a separate cookie store from a non-incognito wind
ow.", |
| 30 "properties": { |
| 31 "id": {"type": "string", "description": "The unique identifier for the
cookie store."}, |
| 32 "tabIds": {"type": "array", "items": {"type": "integer"}, "description
": "Identifiers of all the browser tabs that share this cookie store."} |
| 33 } |
| 34 } |
| 35 ], |
| 36 "functions": [ |
| 37 { |
| 38 "name": "get", |
| 39 "type": "function", |
| 40 "description": "Retrieves information about a single cookie. If more tha
n one cookie of the same name exists for the given URL, the one with the longest
path will be returned. For cookies with the same path length, the cookie with t
he earliest creation time will be returned.", |
| 41 "parameters": [ |
| 42 { |
| 43 "type": "object", |
| 44 "name": "details", |
| 45 "description": "Details to identify the cookie being retrieved.", |
| 46 "properties": { |
| 47 "url": {"type": "string", "description": "The URL with which the c
ookie to retrieve is associated. This argument may be a full URL, in which case
any data following the URL path (e.g. the query string) is simply ignored. If ho
st permissions for this URL are not specified in the manifest file, the API call
will fail."}, |
| 48 "name": {"type": "string", "description": "The name of the cookie
to retrieve."}, |
| 49 "storeId": {"type": "string", "optional": true, "description": "Th
e ID of the cookie store in which to look for the cookie. By default, the curren
t execution context's cookie store will be used."} |
| 50 } |
| 51 }, |
| 52 { |
| 53 "type": "function", |
| 54 "name": "callback", |
| 55 "parameters": [ |
| 56 { |
| 57 "name": "cookie", "$ref": "Cookie", "optional": true, "descripti
on": "Contains details about the cookie. This parameter is null if no such cooki
e was found." |
| 58 } |
| 59 ] |
| 60 } |
| 61 ] |
| 62 }, |
| 63 { |
| 64 "name": "getAll", |
| 65 "type": "function", |
| 66 "description": "Retrieves all cookies from a single cookie store that ma
tch the given information. The cookies returned will be sorted, with those with
the longest path first. If multiple cookies have the same path length, those w
ith the earliest creation time will be first.", |
| 67 "parameters": [ |
| 68 { |
| 69 "type": "object", |
| 70 "name": "details", |
| 71 "description": "Information to filter the cookies being retrieved.", |
| 72 "properties": { |
| 73 "url": {"type": "string", "optional": true, "description": "Restri
cts the retrieved cookies to those that would match the given URL."}, |
| 74 "name": {"type": "string", "optional": true, "description": "Filte
rs the cookies by name."}, |
| 75 "domain": {"type": "string", "optional": true, "description": "Res
tricts the retrieved cookies to those whose domains match or are subdomains of t
his one."}, |
| 76 "path": {"type": "string", "optional": true, "description": "Restr
icts the retrieved cookies to those whose path exactly matches this string."}, |
| 77 "secure": {"type": "boolean", "optional": true, "description": "Fi
lters the cookies by their Secure property."}, |
| 78 "session": {"type": "boolean", "optional": true, "description": "F
ilters out session vs. persistent cookies."}, |
| 79 "storeId": {"type": "string", "optional": true, "description": "Th
e cookie store to retrieve cookies from. If omitted, the current execution conte
xt's cookie store will be used."} |
| 80 } |
| 81 }, |
| 82 { |
| 83 "type": "function", |
| 84 "name": "callback", |
| 85 "parameters": [ |
| 86 { |
| 87 "name": "cookies", "type": "array", "items": {"$ref": "Cookie"},
"description": "All the existing, unexpired cookies that match the given cookie
info." |
| 88 } |
| 89 ] |
| 90 } |
| 91 ] |
| 92 }, |
| 93 { |
| 94 "name": "set", |
| 95 "type": "function", |
| 96 "description": "Sets a cookie with the given cookie data; may overwrite
equivalent cookies if they exist.", |
| 97 "parameters": [ |
| 98 { |
| 99 "type": "object", |
| 100 "name": "details", |
| 101 "description": "Details about the cookie being set.", |
| 102 "properties": { |
| 103 "url": {"type": "string", "description": "The request-URI to assoc
iate with the setting of the cookie. This value can affect the default domain an
d path values of the created cookie. If host permissions for this URL are not sp
ecified in the manifest file, the API call will fail."}, |
| 104 "name": {"type": "string", "optional": true, "description": "The n
ame of the cookie. Empty by default if omitted."}, |
| 105 "value": {"type": "string", "optional": true, "description": "The
value of the cookie. Empty by default if omitted."}, |
| 106 "domain": {"type": "string", "optional": true, "description": "The
domain of the cookie. If omitted, the cookie becomes a host-only cookie."}, |
| 107 "path": {"type": "string", "optional": true, "description": "The p
ath of the cookie. Defaults to the path portion of the url parameter."}, |
| 108 "secure": {"type": "boolean", "optional": true, "description": "Wh
ether the cookie should be marked as Secure. Defaults to false."}, |
| 109 "httpOnly": {"type": "boolean", "optional": true, "description": "
Whether the cookie should be marked as HttpOnly. Defaults to false."}, |
| 110 "expirationDate": {"type": "number", "optional": true, "descriptio
n": "The expiration date of the cookie as the number of seconds since the UNIX e
poch. If omitted, the cookie becomes a session cookie."}, |
| 111 "storeId": {"type": "string", "optional": true, "description": "Th
e ID of the cookie store in which to set the cookie. By default, the cookie is s
et in the current execution context's cookie store."} |
| 112 } |
| 113 }, |
| 114 { |
| 115 "type": "function", |
| 116 "name": "callback", |
| 117 "optional": true, |
| 118 "min_version": "11.0.674.0", |
| 119 "parameters": [ |
| 120 { |
| 121 "name": "cookie", "$ref": "Cookie", "optional": true, "descripti
on": "Contains details about the cookie that's been set. If setting failed for
any reason, this will be \"null\", and \"chrome.runtime.lastError\" will be set.
" |
| 122 } |
| 123 ] |
| 124 } |
| 125 ] |
| 126 }, |
| 127 { |
| 128 "name": "remove", |
| 129 "type": "function", |
| 130 "description": "Deletes a cookie by name.", |
| 131 "parameters": [ |
| 132 { |
| 133 "type": "object", |
| 134 "name": "details", |
| 135 "description": "Information to identify the cookie to remove.", |
| 136 "properties": { |
| 137 "url": {"type": "string", "description": "The URL associated with
the cookie. If host permissions for this URL are not specified in the manifest f
ile, the API call will fail."}, |
| 138 "name": {"type": "string", "description": "The name of the cookie
to remove."}, |
| 139 "storeId": {"type": "string", "optional": true, "description": "Th
e ID of the cookie store to look in for the cookie. If unspecified, the cookie i
s looked for by default in the current execution context's cookie store."} |
| 140 } |
| 141 }, |
| 142 { |
| 143 "type": "function", |
| 144 "name": "callback", |
| 145 "optional": true, |
| 146 "min_version": "11.0.674.0", |
| 147 "parameters": [ |
| 148 { |
| 149 "name": "details", |
| 150 "type": "object", |
| 151 "description": "Contains details about the cookie that's been re
moved. If removal failed for any reason, this will be \"null\", and \"chrome.ru
ntime.lastError\" will be set.", |
| 152 "optional": true, |
| 153 "properties": { |
| 154 "url": {"type": "string", "description": "The URL associated w
ith the cookie that's been removed."}, |
| 155 "name": {"type": "string", "description": "The name of the coo
kie that's been removed."}, |
| 156 "storeId": {"type": "string", "description": "The ID of the co
okie store from which the cookie was removed."} |
| 157 } |
| 158 } |
| 159 ] |
| 160 } |
| 161 ] |
| 162 }, |
| 163 { |
| 164 "name": "getAllCookieStores", |
| 165 "type": "function", |
| 166 "description": "Lists all existing cookie stores.", |
| 167 "parameters": [ |
| 168 { |
| 169 "type": "function", |
| 170 "name": "callback", |
| 171 "parameters": [ |
| 172 { |
| 173 "name": "cookieStores", "type": "array", "items": {"$ref": "Cook
ieStore"}, "description": "All the existing cookie stores." |
| 174 } |
| 175 ] |
| 176 } |
| 177 ] |
| 178 } |
| 179 ], |
| 180 "events": [ |
| 181 { |
| 182 "name": "onChanged", |
| 183 "type": "function", |
| 184 "description": "Fired when a cookie is set or removed. As a special case
, note that updating a cookie's properties is implemented as a two step process:
the cookie to be updated is first removed entirely, generating a notification w
ith \"cause\" of \"overwrite\" . Afterwards, a new cookie is written with the u
pdated values, generating a second notification with \"cause\" \"explicit\".", |
| 185 "parameters": [ |
| 186 { |
| 187 "type": "object", |
| 188 "name": "changeInfo", |
| 189 "properties": { |
| 190 "removed": {"type": "boolean", "description": "True if a cookie wa
s removed."}, |
| 191 "cookie": {"$ref": "Cookie", "description": "Information about the
cookie that was set or removed."}, |
| 192 "cause": {"min_version": "12.0.707.0", "type": "string", "enum": [
"evicted", "expired", "explicit", "expired_overwrite", "overwrite"], "descriptio
n": "The underlying reason behind the cookie's change. If a cookie was inserted,
or removed via an explicit call to \"chrome.cookies.remove\", \"cause\" will be
\"explicit\". If a cookie was automatically removed due to expiry, \"cause\" wi
ll be \"expired\". If a cookie was removed due to being overwritten with an alre
ady-expired expiration date, \"cause\" will be set to \"expired_overwrite\". If
a cookie was automatically removed due to garbage collection, \"cause\" will be
\"evicted\". If a cookie was automatically removed due to a \"set\" call that
overwrote it, \"cause\" will be \"overwrite\". Plan your response accordingly."} |
| 193 } |
| 194 } |
| 195 ] |
| 196 } |
| 197 ] |
| 198 } |
| 199 ] |
| OLD | NEW |