You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`locale` <?[string]> Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language` request header value as well as number and date formatting rules.
201
201
-`permissions` <[Object]> A map from origin keys to permissions values. See [browserContext.setPermissions](#browsercontextsetpermissionsorigin-permissions) for more details.
202
+
-`extraHTTPHeaders` <[Object]> An object containing additional HTTP headers to be sent with every request. All header values must be strings.
202
203
- returns: <[Promise]<[BrowserContext]>>
203
204
204
205
Creates a new browser context. It won't share cookies/cache with other browser contexts.
@@ -232,6 +233,7 @@ Creates a new browser context. It won't share cookies/cache with other browser c
-`locale` <?[string]> Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language` request header value as well as number and date formatting rules.
234
235
-`permissions` <[Object]> A map from origin keys to permissions values. See [browserContext.setPermissions](#browsercontextsetpermissionsorigin-permissions) for more details.
236
+
-`extraHTTPHeaders` <[Object]> An object containing additional HTTP headers to be sent with every request. All header values must be strings.
235
237
- returns: <[Promise]<[Page]>>
236
238
237
239
Creates a new page in a new browser context. Closing this page will close the context as well.
@@ -374,6 +377,14 @@ This setting will change the default maximum time for all the methods accepting
374
377
375
378
> **NOTE**[`page.setDefaultNavigationTimeout`](#pagesetdefaultnavigationtimeouttimeout), [`page.setDefaultTimeout`](#pagesetdefaulttimeouttimeout) and [`browserContext.setDefaultNavigationTimeout`](#browsercontextsetdefaultnavigationtimeouttimeout) take priority over [`browserContext.setDefaultTimeout`](#browserContextsetdefaulttimeouttimeout).
376
379
380
+
#### browserContext.setExtraHTTPHeaders(headers)
381
+
-`headers` <[Object]> An object containing additional HTTP headers to be sent with every request. All header values must be strings.
382
+
- returns: <[Promise]>
383
+
384
+
The extra HTTP headers will be sent with every request initiated by any page in the context. These headers are merged with page-specific extra HTTP headers set with [page.setExtraHTTPHeaders()](#pagesetextrahttpheadersheaders). If page overrides a particular header, page-specific header value will be used instead of the browser context header value.
385
+
386
+
> **NOTE**`browserContext.setExtraHTTPHeaders` does not guarantee the order of headers in the outgoing requests.
387
+
377
388
#### browserContext.setGeolocation(geolocation)
378
389
-`geolocation` <[Object]>
379
390
-`latitude` <[number]> Latitude between -90 and 90.
0 commit comments