playwright-core
Advanced tools
Comparing version 0.11.1-next.1584853682027 to 0.11.1-next.1584893448585
@@ -85,2 +85,3 @@ "use strict"; | ||
viewport, | ||
locale: options.locale, | ||
removeOnDetach: true | ||
@@ -154,2 +155,4 @@ }); | ||
await this.setHTTPCredentials(this._options.httpCredentials); | ||
if (this._options.geolocation) | ||
await this.setGeolocation(this._options.geolocation); | ||
} | ||
@@ -219,4 +222,3 @@ _ffPages() { | ||
this._options.geolocation = geolocation || undefined; | ||
for (const page of this.pages()) | ||
await page._delegate._setGeolocation(geolocation); | ||
await this._browser._connection.send('Browser.setGeolocationOverride', { browserContextId: this._browserContextId || undefined, geolocation }); | ||
} | ||
@@ -257,4 +259,4 @@ async setExtraHTTPHeaders(headers) { | ||
this._routes.push({ url, handler }); | ||
throw new Error('Not implemented'); | ||
// TODO: update interception on the context if this is a first route. | ||
if (this._routes.length === 1) | ||
await this._browser._connection.send('Browser.setRequestInterception', { browserContextId: this._browserContextId || undefined, enabled: true }); | ||
} | ||
@@ -261,0 +263,0 @@ async close() { |
@@ -72,4 +72,2 @@ "use strict"; | ||
async _initialize() { | ||
const geolocation = this._browserContext._options.geolocation; | ||
const language = this._browserContext._options.locale; | ||
try { | ||
@@ -82,4 +80,2 @@ await Promise.all([ | ||
}), | ||
geolocation ? this._setGeolocation(geolocation) : Promise.resolve(), | ||
language ? this._session.send('Page.setLanguageOverride', { language }) : Promise.resolve(), | ||
new Promise(f => this._session.once('Page.ready', f)), | ||
@@ -418,5 +414,2 @@ ]); | ||
} | ||
async _setGeolocation(geolocation) { | ||
await this._session.send('Page.setGeolocationOverride', geolocation || {}); | ||
} | ||
} | ||
@@ -423,0 +416,0 @@ exports.FFPage = FFPage; |
{ | ||
"name": "playwright-core", | ||
"version": "0.11.1-next.1584853682027", | ||
"version": "0.11.1-next.1584893448585", | ||
"description": "A high-level API to automate web browsers", | ||
@@ -12,3 +12,3 @@ "repository": "github:Microsoft/playwright", | ||
"chromium_revision": "751710", | ||
"firefox_revision": "1047", | ||
"firefox_revision": "1048", | ||
"webkit_revision": "1182" | ||
@@ -15,0 +15,0 @@ }, |
Sorry, the diff of this file is too big to display
1914650
46797