Skip to content

Commit 9c80cbd

Browse files
authored
fix(docs): small docs changes for new apis (#4305)
1 parent 94cb7c9 commit 9c80cbd

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

docs/api.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ Indicates that the browser is connected.
223223
- `password` <[string]>
224224
- `colorScheme` <"light"|"dark"|"no-preference"> Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See [page.emulateMedia(options)](#pageemulatemediaoptions) for more details. Defaults to '`light`'.
225225
- `logger` <[Logger]> Logger sink for Playwright logging.
226-
- `proxy` <[Object]> Network proxy settings to use with this context. Note that browser needs to be launched with the global proxy for this option to work. If all contexts override the proxy, global proxy will be never used and can be any string, for example `launch({ proxy: { server: 'per-proxy' } })`.
226+
- `proxy` <[Object]> Network proxy settings to use with this context. Note that browser needs to be launched with the global proxy for this option to work. If all contexts override the proxy, global proxy will be never used and can be any string, for example `launch({ proxy: { server: 'per-context' } })`.
227227
- `server` <[string]> Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.
228228
- `bypass` <[string]> Optional coma-separated domains to bypass proxy, for example `".com, chromium.org, .domain.com"`.
229229
- `username` <[string]> Optional username to use if HTTP proxy requires authentication.
@@ -234,7 +234,7 @@ Indicates that the browser is connected.
234234
- `height` <[number]> Video frame height.
235235
- `recordHar` <[Object]> Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `har.path` file. If not specified, the HAR is not recorded. Make sure to await [`browserContext.close`](#browsercontextclose) for the HAR to be saved.
236236
- `omitContent` <[boolean]> Optional setting to control whether to omit request content from the HAR. Defaults to `false`.
237-
- `path` <[string]> path on the filesystem to write the HAR file to.
237+
- `path` <[string]> Path on the filesystem to write the HAR file to.
238238
- returns: <[Promise]<[BrowserContext]>>
239239

240240
Creates a new browser context. It won't share cookies/cache with other browser contexts.
@@ -277,7 +277,7 @@ Creates a new browser context. It won't share cookies/cache with other browser c
277277
- `password` <[string]>
278278
- `colorScheme` <"light"|"dark"|"no-preference"> Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See [page.emulateMedia(options)](#pageemulatemediaoptions) for more details. Defaults to '`light`'.
279279
- `logger` <[Logger]> Logger sink for Playwright logging.
280-
- `proxy` <[Object]> Network proxy settings to use with this context. Note that browser needs to be launched with the global proxy for this option to work. If all contexts override the proxy, global proxy will be never used and can be any string, for example `launch({ proxy: { server: 'per-proxy' } })`.
280+
- `proxy` <[Object]> Network proxy settings to use with this context. Note that browser needs to be launched with the global proxy for this option to work. If all contexts override the proxy, global proxy will be never used and can be any string, for example `launch({ proxy: { server: 'per-context' } })`.
281281
- `server` <[string]> Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.
282282
- `bypass` <[string]> Optional coma-separated domains to bypass proxy, for example `".com, chromium.org, .domain.com"`.
283283
- `username` <[string]> Optional username to use if HTTP proxy requires authentication.
@@ -288,7 +288,7 @@ Creates a new browser context. It won't share cookies/cache with other browser c
288288
- `height` <[number]> Video frame height.
289289
- `recordHar` <[Object]> Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `har.path` file. If not specified, the HAR is not recorded. Make sure to await [`page.close`](#pagecontext) for the HAR to be saved.
290290
- `omitContent` <[boolean]> Optional setting to control whether to omit request content from the HAR. Defaults to `false`.
291-
- `path` <[string]> path on the filesystem to write the HAR file to
291+
- `path` <[string]> Path on the filesystem to write the HAR file to.
292292
- returns: <[Promise]<[Page]>>
293293

294294
Creates a new page in a new browser context. Closing this page will close the context as well.
@@ -3921,10 +3921,10 @@ ResourceType will be one of the following: `document`, `stylesheet`, `image`, `m
39213921
- `domainLookupStart` <[number]> Time immediately before the browser starts the domain name lookup for the resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
39223922
- `domainLookupEnd` <[number]> Time immediately after the browser starts the domain name lookup for the resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
39233923
- `connectStart` <[number]> Time immediately before the user agent starts establishing the connection to the server to retrieve the resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
3924-
- `secureConnectionStart` <[number]> immediately before the browser starts the handshake process to secure the current connection. The value is given in milliseconds relative to `startTime`, -1 if not available.
3924+
- `secureConnectionStart` <[number]> Time immediately before the browser starts the handshake process to secure the current connection. The value is given in milliseconds relative to `startTime`, -1 if not available.
39253925
- `connectEnd` <[number]> Time immediately before the user agent starts establishing the connection to the server to retrieve the resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
39263926
- `requestStart` <[number]> Time immediately before the browser starts requesting the resource from the server, cache, or local resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
3927-
- `responseStart` <[number]> immediately after the browser starts requesting the resource from the server, cache, or local resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
3927+
- `responseStart` <[number]> Time immediately after the browser starts requesting the resource from the server, cache, or local resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
39283928
- `responseEnd` <[number]> Time immediately after the browser receives the last byte of the resource or immediately before the transport connection is closed, whichever comes first. The value is given in milliseconds relative to `startTime`, -1 if not available.
39293929
};
39303930

@@ -4483,7 +4483,7 @@ const browser = await chromium.launch({ // Or 'firefox' or 'webkit'.
44834483
- `height` <[number]> Video frame height.
44844484
- `recordHar` <[Object]> Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all the pages into `har.path` file. If not specified, HAR is not recorded. Make sure to await [`page.close`](#pagecontext) for HAR to be saved.
44854485
- `omitContent` <[boolean]> Optional setting to control whether to omit request content from the HAR. Defaults to false.
4486-
- `path` <[string]> path on the filesystem to write the HAR file to
4486+
- `path` <[string]> Path on the filesystem to write the HAR file to.
44874487
- returns: <[Promise]<[BrowserContext]>> Promise that resolves to the persistent browser context instance.
44884488

44894489
Launches browser that uses persistent storage located at `userDataDir` and returns the only context. Closing this context will automatically close the browser.

src/server/browserContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ export function validateBrowserContextOptions(options: types.BrowserContextOptio
324324
options.viewport = { width: 1280, height: 720 };
325325
if (options.proxy) {
326326
if (!browserOptions.proxy)
327-
throw new Error(`Browser needs to be launched with the global proxy. If all contexts override the proxy, global proxy will be never used and can be any string, for example "launch({ proxy: { server: 'per-proxy' } })"`);
327+
throw new Error(`Browser needs to be launched with the global proxy. If all contexts override the proxy, global proxy will be never used and can be any string, for example "launch({ proxy: { server: 'per-context' } })"`);
328328
options.proxy = normalizeProxySettings(options.proxy);
329329
}
330330
verifyGeolocation(options.geolocation);

test/browsercontext-proxy.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { folio as baseFolio } from './fixtures';
1818

1919
const fixtures = baseFolio.extend();
2020
fixtures.browserOptions.override(async ({ browserOptions }, run) => {
21-
await run({ ...browserOptions, proxy: { server: 'per-proxy' } });
21+
await run({ ...browserOptions, proxy: { server: 'per-context' } });
2222
});
2323

2424
const { it, expect } = fixtures.build();

0 commit comments

Comments
 (0)