mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
browser(firefox): support start/stop videos for context (#8173)
This commit is contained in:
parent
b4920fe699
commit
dba3c5055f
@ -1,2 +1,2 @@
|
|||||||
1276
|
1277
|
||||||
Changed: yurys@chromium.org Wed 11 Aug 2021 01:41:01 PM PDT
|
Changed: dgozman@gmail.com Thu Aug 12 16:33:32 PDT 2021
|
||||||
|
@ -917,11 +917,13 @@ class BrowserContext {
|
|||||||
|
|
||||||
async setVideoRecordingOptions(options) {
|
async setVideoRecordingOptions(options) {
|
||||||
this.videoRecordingOptions = options;
|
this.videoRecordingOptions = options;
|
||||||
if (!options)
|
|
||||||
return;
|
|
||||||
const promises = [];
|
const promises = [];
|
||||||
for (const page of this.pages)
|
for (const page of this.pages) {
|
||||||
promises.push(page._startVideoRecording(options));
|
if (options)
|
||||||
|
promises.push(page._startVideoRecording(options));
|
||||||
|
else if (page._videoRecordingInfo)
|
||||||
|
promises.push(page._stopVideoRecording());
|
||||||
|
}
|
||||||
await Promise.all(promises);
|
await Promise.all(promises);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -213,8 +213,8 @@ class BrowserHandler {
|
|||||||
await this._targetRegistry.browserContextForId(browserContextId).setForcedColors(nullToUndefined(forcedColors));
|
await this._targetRegistry.browserContextForId(browserContextId).setForcedColors(nullToUndefined(forcedColors));
|
||||||
}
|
}
|
||||||
|
|
||||||
async ['Browser.setVideoRecordingOptions']({browserContextId, dir, width, height, scale}) {
|
async ['Browser.setVideoRecordingOptions']({browserContextId, options}) {
|
||||||
await this._targetRegistry.browserContextForId(browserContextId).setVideoRecordingOptions({dir, width, height, scale});
|
await this._targetRegistry.browserContextForId(browserContextId).setVideoRecordingOptions(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
async ['Browser.setUserAgentOverride']({browserContextId, userAgent}) {
|
async ['Browser.setUserAgentOverride']({browserContextId, userAgent}) {
|
||||||
|
@ -453,9 +453,11 @@ const Browser = {
|
|||||||
'setVideoRecordingOptions': {
|
'setVideoRecordingOptions': {
|
||||||
params: {
|
params: {
|
||||||
browserContextId: t.Optional(t.String),
|
browserContextId: t.Optional(t.String),
|
||||||
dir: t.String,
|
options: t.Optional({
|
||||||
width: t.Number,
|
dir: t.String,
|
||||||
height: t.Number,
|
width: t.Number,
|
||||||
|
height: t.Number,
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'cancelDownload': {
|
'cancelDownload': {
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
1282
|
1283
|
||||||
Changed: yurys@chromium.org Wed 11 Aug 2021 01:40:40 PM PDT
|
Changed: dgozman@gmail.com Thu Aug 12 16:33:32 PDT 2021
|
||||||
|
@ -917,11 +917,13 @@ class BrowserContext {
|
|||||||
|
|
||||||
async setVideoRecordingOptions(options) {
|
async setVideoRecordingOptions(options) {
|
||||||
this.videoRecordingOptions = options;
|
this.videoRecordingOptions = options;
|
||||||
if (!options)
|
|
||||||
return;
|
|
||||||
const promises = [];
|
const promises = [];
|
||||||
for (const page of this.pages)
|
for (const page of this.pages) {
|
||||||
promises.push(page._startVideoRecording(options));
|
if (options)
|
||||||
|
promises.push(page._startVideoRecording(options));
|
||||||
|
else if (page._videoRecordingInfo)
|
||||||
|
promises.push(page._stopVideoRecording());
|
||||||
|
}
|
||||||
await Promise.all(promises);
|
await Promise.all(promises);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -213,8 +213,8 @@ class BrowserHandler {
|
|||||||
await this._targetRegistry.browserContextForId(browserContextId).setForcedColors(nullToUndefined(forcedColors));
|
await this._targetRegistry.browserContextForId(browserContextId).setForcedColors(nullToUndefined(forcedColors));
|
||||||
}
|
}
|
||||||
|
|
||||||
async ['Browser.setVideoRecordingOptions']({browserContextId, dir, width, height, scale}) {
|
async ['Browser.setVideoRecordingOptions']({browserContextId, options}) {
|
||||||
await this._targetRegistry.browserContextForId(browserContextId).setVideoRecordingOptions({dir, width, height, scale});
|
await this._targetRegistry.browserContextForId(browserContextId).setVideoRecordingOptions(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
async ['Browser.setUserAgentOverride']({browserContextId, userAgent}) {
|
async ['Browser.setUserAgentOverride']({browserContextId, userAgent}) {
|
||||||
|
@ -453,9 +453,11 @@ const Browser = {
|
|||||||
'setVideoRecordingOptions': {
|
'setVideoRecordingOptions': {
|
||||||
params: {
|
params: {
|
||||||
browserContextId: t.Optional(t.String),
|
browserContextId: t.Optional(t.String),
|
||||||
dir: t.String,
|
options: t.Optional({
|
||||||
width: t.Number,
|
dir: t.String,
|
||||||
height: t.Number,
|
width: t.Number,
|
||||||
|
height: t.Number,
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'cancelDownload': {
|
'cancelDownload': {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user