added SameSiteStatus to chrome.cookies in Chrome package (#43023)

* added dictionary {size -> ImageData} option to imageData property

* exposed concealed ClassValue type in classnames package

* corrections per tslint

* moved additional types into namespace

* added SameSiteStatus to chrome.cookies

* synced up classnames

* fixed newline

* made sameSite optional in SetDetails

* added @since Chrome 51. moniker to sameSite

* added sameSite to cookies in sinon-chrome package
This commit is contained in:
jacamera
2020-03-12 19:51:59 -04:00
committed by GitHub
parent 06b0334e47
commit 4e0fe9b953
2 changed files with 17 additions and 2 deletions

View File

@@ -1266,6 +1266,9 @@ declare namespace chrome.contextMenus {
* Permissions: "cookies", host permissions
*/
declare namespace chrome.cookies {
/** A cookie's 'SameSite' state (https://tools.ietf.org/html/draft-west-first-party-cookies). 'no_restriction' corresponds to a cookie set with 'SameSite=None', 'lax' to 'SameSite=Lax', and 'strict' to 'SameSite=Strict'. 'unspecified' corresponds to a cookie set without the SameSite attribute. **/
export type SameSiteStatus = 'unspecified' | 'no_restriction' | 'lax' | 'strict';
/** Represents information about an HTTP cookie. */
export interface Cookie {
/** The domain of the cookie (e.g. "www.google.com", "example.com"). */
@@ -1288,6 +1291,11 @@ declare namespace chrome.cookies {
httpOnly: boolean;
/** True if the cookie is marked as Secure (i.e. its scope is limited to secure channels, typically HTTPS). */
secure: boolean;
/**
* The cookie's same-site status (i.e. whether the cookie is sent with cross-site requests).
* @since Chrome 51.
*/
sameSite: SameSiteStatus
}
/** Represents a cookie store in the browser. An incognito mode window, for instance, uses a separate cookie store from a non-incognito window. */
@@ -1334,6 +1342,11 @@ declare namespace chrome.cookies {
httpOnly?: boolean;
/** Optional. Whether the cookie should be marked as Secure. Defaults to false. */
secure?: boolean;
/**
* Optional. The cookie's same-site status. Defaults to "unspecified", i.e., if omitted, the cookie is set without specifying a SameSite attribute.
* @since Chrome 51.
*/
sameSite?: SameSiteStatus
}
export interface Details {

View File

@@ -64,7 +64,8 @@ chromeStub.registerPlugin(new chromeStub.plugins.CookiePlugin(
secure: false,
session: false,
storeId: '0',
value: 'COOKIE_VALUE'
value: 'COOKIE_VALUE',
sameSite: 'unspecified'
},
{
domain: 'other-domain.com',
@@ -75,7 +76,8 @@ chromeStub.registerPlugin(new chromeStub.plugins.CookiePlugin(
secure: false,
session: true,
storeId: '0',
value: '123'
value: '123',
sameSite: 'unspecified'
}
]
));