mirror of
https://forge.fsky.io/oneflux/omegafox.git
synced 2026-02-10 13:12:03 -08:00
Fix viewport hijacking
Do not allow Juggler to set its default viewport size if Camoufox set it first
This commit is contained in:
parent
fcacf8106d
commit
b9d1503487
1 changed files with 13 additions and 0 deletions
|
|
@ -530,6 +530,19 @@ class PageTarget {
|
|||
// The "default size" (1) is only respected when the page is opened.
|
||||
// Otherwise, explicitly set page viewport prevales over browser context
|
||||
// default viewport.
|
||||
|
||||
// Do not allow default viewport size if Camoufox set it first
|
||||
if (
|
||||
!viewportSize &&
|
||||
this._browserContext.defaultViewportSize && (
|
||||
ChromeUtils.camouGetConfig("window.outerWidth") ||
|
||||
ChromeUtils.camouGetConfig("window.outerHeight") ||
|
||||
ChromeUtils.camouGetConfig("window.innerWidth") ||
|
||||
ChromeUtils.camouGetConfig("window.innerHeight"))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const viewportSize = this._viewportSize || this._browserContext.defaultViewportSize;
|
||||
if (viewportSize) {
|
||||
const {width, height} = viewportSize;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue