Skip to content

Commit

Permalink
cherry-pick(#35058): chore: hide indexedDB from storageState() and Br…
Browse files Browse the repository at this point in the history
…owserContext option
  • Loading branch information
mxschmitt committed Mar 6, 2025
1 parent 9e9f0d1 commit 1f13108
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 62 deletions.
1 change: 0 additions & 1 deletion docs/src/api/class-apirequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ Methods like [`method: APIRequestContext.get`] take the base URL into considerat
- `localStorage` <[Array]<[Object]>>
- `name` <[string]>
- `value` <[string]>
- `indexedDB` ?<[Array]<[unknown]>> indexedDB to set for context

Populates context with given storage state. This option can be used to initialize context with logged-in information
obtained via [`method: BrowserContext.storageState`] or [`method: APIRequestContext.storageState`]. Either a path to the
Expand Down
1 change: 0 additions & 1 deletion docs/src/api/class-apirequestcontext.md
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,6 @@ context cookies from the response. The method will automatically follow redirect
- `localStorage` <[Array]<[Object]>>
- `name` <[string]>
- `value` <[string]>
- `indexedDB` <[Array]<[unknown]>>

Returns storage state for this request context, contains current cookies and local storage snapshot if it was passed to the constructor.

Expand Down
1 change: 0 additions & 1 deletion docs/src/api/class-browsercontext.md
Original file line number Diff line number Diff line change
Expand Up @@ -1511,7 +1511,6 @@ Whether to emulate network being offline for the browser context.
- `localStorage` <[Array]<[Object]>>
- `name` <[string]>
- `value` <[string]>
- `indexedDB` <[Array]<[unknown]>>

Returns storage state for this browser context, contains current cookies, local storage snapshot and IndexedDB snapshot.

Expand Down
1 change: 0 additions & 1 deletion docs/src/api/params.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ Specify environment variables that will be visible to the browser. Defaults to `
- `localStorage` <[Array]<[Object]>> localStorage to set for context
- `name` <[string]>
- `value` <[string]>
- `indexedDB` ?<[Array]<[unknown]>> indexedDB to set for context

Learn more about [storage state and auth](../auth.md).

Expand Down
19 changes: 0 additions & 19 deletions packages/playwright-client/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9317,8 +9317,6 @@ export interface BrowserContext {

value: string;
}>;

indexedDB: Array<unknown>;
}>;
}>;

Expand Down Expand Up @@ -10085,11 +10083,6 @@ export interface Browser {

value: string;
}>;

/**
* indexedDB to set for context
*/
indexedDB?: Array<unknown>;
}>;
};

Expand Down Expand Up @@ -17638,11 +17631,6 @@ export interface APIRequest {

value: string;
}>;

/**
* indexedDB to set for context
*/
indexedDB?: Array<unknown>;
}>;
};

Expand Down Expand Up @@ -18457,8 +18445,6 @@ export interface APIRequestContext {

value: string;
}>;

indexedDB: Array<unknown>;
}>;
}>;

Expand Down Expand Up @@ -22306,11 +22292,6 @@ export interface BrowserContextOptions {

value: string;
}>;

/**
* indexedDB to set for context
*/
indexedDB?: Array<unknown>;
}>;
};

Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/src/client/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export type SelectOptionOptions = { force?: boolean, timeout?: number };
export type FilePayload = { name: string, mimeType: string, buffer: Buffer };
export type StorageState = {
cookies: channels.NetworkCookie[],
origins: (Omit<channels.OriginStorage, 'indexedDB'> & { indexedDB: unknown[] })[],
origins: (Omit<channels.OriginStorage, 'indexedDB'>)[],
};
export type SetStorageState = {
cookies?: channels.SetNetworkCookie[],
Expand Down
19 changes: 0 additions & 19 deletions packages/playwright-core/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9317,8 +9317,6 @@ export interface BrowserContext {

value: string;
}>;

indexedDB: Array<unknown>;
}>;
}>;

Expand Down Expand Up @@ -10085,11 +10083,6 @@ export interface Browser {

value: string;
}>;

/**
* indexedDB to set for context
*/
indexedDB?: Array<unknown>;
}>;
};

Expand Down Expand Up @@ -17638,11 +17631,6 @@ export interface APIRequest {

value: string;
}>;

/**
* indexedDB to set for context
*/
indexedDB?: Array<unknown>;
}>;
};

Expand Down Expand Up @@ -18457,8 +18445,6 @@ export interface APIRequestContext {

value: string;
}>;

indexedDB: Array<unknown>;
}>;
}>;

Expand Down Expand Up @@ -22306,11 +22292,6 @@ export interface BrowserContextOptions {

value: string;
}>;

/**
* indexedDB to set for context
*/
indexedDB?: Array<unknown>;
}>;
};

Expand Down
40 changes: 21 additions & 19 deletions tests/library/global-fetch-cookie.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,25 +352,27 @@ it('should preserve local storage on import/export of storage state', async ({ p
name: 'name1',
value: 'value1'
}],
indexedDB: [
{
name: 'db',
version: 5,
stores: [
{
name: 'store',
keyPath: 'id',
autoIncrement: false,
indexes: [],
records: [
{
value: { id: 'foo', name: 'John Doe' }
}
],
}
]
}
],
...{
indexedDB: [
{
name: 'db',
version: 5,
stores: [
{
name: 'store',
keyPath: 'id',
autoIncrement: false,
indexes: [],
records: [
{
value: { id: 'foo', name: 'John Doe' }
}
],
}
]
}
]
},
},
]
};
Expand Down

0 comments on commit 1f13108

Please sign in to comment.