mirror of
https://github.com/microsoft/playwright.git
synced 2025-01-01 23:58:17 +03:00
browser(firefox): do not crash when browser window is minimized (#9951)
This commit is contained in:
parent
49cda3d3df
commit
ddda507ccd
@ -1,2 +1,2 @@
|
||||
1301
|
||||
Changed: max@schmitt.mx Mon 1 Nov 2021 16:28:05 CET
|
||||
1302
|
||||
Changed: yurys@chromium.org Mon 01 Nov 2021 05:04:30 PM PDT
|
||||
|
@ -159,6 +159,9 @@ class nsScreencastService::Session : public rtc::VideoSinkInterface<webrtc::Vide
|
||||
void OnRawFrame(uint8_t* videoFrame, size_t videoFrameStride, const webrtc::VideoCaptureCapability& frameInfo) override {
|
||||
int pageWidth = frameInfo.width - mMargin.LeftRight();
|
||||
int pageHeight = frameInfo.height - mMargin.TopBottom();
|
||||
// Frame size is 1x1 when browser window is minimized.
|
||||
if (pageWidth <= 1 || pageHeight <= 1)
|
||||
return;
|
||||
// Headed Firefox brings sizes in sync slowly.
|
||||
if (mViewportWidth && pageWidth > mViewportWidth)
|
||||
pageWidth = mViewportWidth;
|
||||
|
@ -1,2 +1,2 @@
|
||||
1299
|
||||
Changed: max@schmitt.mx Mon 1 Nov 2021 16:28:05 CET
|
||||
1300
|
||||
Changed: yurys@chromium.org Mon 01 Nov 2021 05:00:33 PM PDT
|
||||
|
@ -159,6 +159,9 @@ class nsScreencastService::Session : public rtc::VideoSinkInterface<webrtc::Vide
|
||||
void OnRawFrame(uint8_t* videoFrame, size_t videoFrameStride, const webrtc::VideoCaptureCapability& frameInfo) override {
|
||||
int pageWidth = frameInfo.width - mMargin.LeftRight();
|
||||
int pageHeight = frameInfo.height - mMargin.TopBottom();
|
||||
// Frame size is 1x1 when browser window is minimized.
|
||||
if (pageWidth <= 1 || pageHeight <= 1)
|
||||
return;
|
||||
// Headed Firefox brings sizes in sync slowly.
|
||||
if (mViewportWidth && pageWidth > mViewportWidth)
|
||||
pageWidth = mViewportWidth;
|
||||
|
Loading…
Reference in New Issue
Block a user