diff --git a/additions/juggler/TargetRegistry.js b/additions/juggler/TargetRegistry.js index 99665a1..32eaf45 100644 --- a/additions/juggler/TargetRegistry.js +++ b/additions/juggler/TargetRegistry.js @@ -383,11 +383,17 @@ class PageTarget { this._tab = tab; this._linkedBrowser = tab.linkedBrowser; this._browserContext = browserContext; + this._viewportSize = undefined; // Set the viewport size to Camoufox's default value. - this._viewportSize = { - width: ChromeUtils.camouGetInt("window.innerWidth") || 1280, - height: ChromeUtils.camouGetInt("window.innerHeight") || 720, - };; + if ( + ChromeUtils.camouGetInt("window.innerWidth") + || ChromeUtils.camouGetInt("window.innerHeight") + ) { + this._viewportSize = { + width: ChromeUtils.camouGetInt("window.innerWidth") || 1280, + height: ChromeUtils.camouGetInt("window.innerHeight") || 720, + }; + } this._initialDPPX = this._linkedBrowser.browsingContext.overrideDPPX; this._url = 'about:blank'; this._openerId = opener ? opener.id() : undefined;