chore: make localStorage optional when setting storage state

This commit is contained in:
Simon Knott 2025-02-05 14:20:52 +01:00
parent 311625b891
commit 15535b9fe0
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC
6 changed files with 8 additions and 8 deletions

View file

@ -61,7 +61,7 @@ Methods like [`method: APIRequestContext.get`] take the base URL into considerat
- `sameSite` <[SameSiteAttribute]<"Strict"|"Lax"|"None">> - `sameSite` <[SameSiteAttribute]<"Strict"|"Lax"|"None">>
- `origins` <[Array]<[Object]>> - `origins` <[Array]<[Object]>>
- `origin` <[string]> - `origin` <[string]>
- `localStorage` <[Array]<[Object]>> - `localStorage` ?<[Array]<[Object]>>
- `name` <[string]> - `name` <[string]>
- `value` <[string]> - `value` <[string]>
- `indexedDB` ?<[Array]<[Object]>> indexedDB to set for context - `indexedDB` ?<[Array]<[Object]>> indexedDB to set for context

View file

@ -261,7 +261,7 @@ Specify environment variables that will be visible to the browser. Defaults to `
- `sameSite` <[SameSiteAttribute]<"Strict"|"Lax"|"None">> sameSite flag - `sameSite` <[SameSiteAttribute]<"Strict"|"Lax"|"None">> sameSite flag
- `origins` <[Array]<[Object]>> - `origins` <[Array]<[Object]>>
- `origin` <[string]> - `origin` <[string]>
- `localStorage` <[Array]<[Object]>> localStorage to set for context - `localStorage` ?<[Array]<[Object]>> localStorage to set for context
- `name` <[string]> - `name` <[string]>
- `value` <[string]> - `value` <[string]>
- `indexedDB` ?<[Array]<[Object]>> indexedDB to set for context - `indexedDB` ?<[Array]<[Object]>> indexedDB to set for context

View file

@ -165,7 +165,7 @@ scheme.IndexedDBDatabase = tObject({
}); });
scheme.SetOriginStorage = tObject({ scheme.SetOriginStorage = tObject({
origin: tString, origin: tString,
localStorage: tArray(tType('NameValue')), localStorage: tOptional(tArray(tType('NameValue'))),
indexedDB: tOptional(tArray(tType('IndexedDBDatabase'))), indexedDB: tOptional(tArray(tType('IndexedDBDatabase'))),
}); });
scheme.OriginStorage = tObject({ scheme.OriginStorage = tObject({

View file

@ -10103,7 +10103,7 @@ export interface Browser {
/** /**
* localStorage to set for context * localStorage to set for context
*/ */
localStorage: Array<{ localStorage?: Array<{
name: string; name: string;
value: string; value: string;
@ -17681,7 +17681,7 @@ export interface APIRequest {
origins: Array<{ origins: Array<{
origin: string; origin: string;
localStorage: Array<{ localStorage?: Array<{
name: string; name: string;
value: string; value: string;
@ -22410,7 +22410,7 @@ export interface BrowserContextOptions {
/** /**
* localStorage to set for context * localStorage to set for context
*/ */
localStorage: Array<{ localStorage?: Array<{
name: string; name: string;
value: string; value: string;

View file

@ -295,7 +295,7 @@ export type IndexedDBDatabase = {
export type SetOriginStorage = { export type SetOriginStorage = {
origin: string, origin: string,
localStorage: NameValue[], localStorage?: NameValue[],
indexedDB?: IndexedDBDatabase[], indexedDB?: IndexedDBDatabase[],
}; };

View file

@ -263,7 +263,7 @@ SetOriginStorage:
properties: properties:
origin: string origin: string
localStorage: localStorage:
type: array type: array?
items: NameValue items: NameValue
indexedDB: indexedDB:
type: array? type: array?