Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/api/class-apirequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Methods like [`method: APIRequestContext.get`] take the base URL into considerat
- `sameSite` <[SameSiteAttribute]<"Strict"|"Lax"|"None">>
- `origins` <[Array]<[Object]>>
- `origin` <[string]>
- `localStorage` <[Array]<[Object]>>
- `localStorage` ?<[Array]<[Object]>>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am surprised that origins and cookies are not optional either. Maybe I was wrong suggesting this change. Perhaps we should do some archeology, or forget about it.

Copy link
Member Author

@Skn0tt Skn0tt Feb 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's forget about it, we can still do this change in the future.

- `name` <[string]>
- `value` <[string]>
- `indexedDB` ?<[Array]<[Object]>> indexedDB to set for context
Expand Down
2 changes: 1 addition & 1 deletion docs/src/api/params.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ Specify environment variables that will be visible to the browser. Defaults to `
- `sameSite` <[SameSiteAttribute]<"Strict"|"Lax"|"None">> sameSite flag
- `origins` <[Array]<[Object]>>
- `origin` <[string]>
- `localStorage` <[Array]<[Object]>> localStorage to set for context
- `localStorage` ?<[Array]<[Object]>> localStorage to set for context
- `name` <[string]>
- `value` <[string]>
- `indexedDB` ?<[Array]<[Object]>> indexedDB to set for context
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/src/protocol/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ scheme.IndexedDBDatabase = tObject({
});
scheme.SetOriginStorage = tObject({
origin: tString,
localStorage: tArray(tType('NameValue')),
localStorage: tOptional(tArray(tType('NameValue'))),
indexedDB: tOptional(tArray(tType('IndexedDBDatabase'))),
});
scheme.OriginStorage = tObject({
Expand Down
6 changes: 3 additions & 3 deletions packages/playwright-core/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10103,7 +10103,7 @@ export interface Browser {
/**
* localStorage to set for context
*/
localStorage: Array<{
localStorage?: Array<{
name: string;

value: string;
Expand Down Expand Up @@ -17681,7 +17681,7 @@ export interface APIRequest {
origins: Array<{
origin: string;

localStorage: Array<{
localStorage?: Array<{
name: string;

value: string;
Expand Down Expand Up @@ -22410,7 +22410,7 @@ export interface BrowserContextOptions {
/**
* localStorage to set for context
*/
localStorage: Array<{
localStorage?: Array<{
name: string;

value: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/src/channels.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export type IndexedDBDatabase = {

export type SetOriginStorage = {
origin: string,
localStorage: NameValue[],
localStorage?: NameValue[],
indexedDB?: IndexedDBDatabase[],
};

Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/src/protocol.yml
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ SetOriginStorage:
properties:
origin: string
localStorage:
type: array
type: array?
items: NameValue
indexedDB:
type: array?
Expand Down
Loading