From fb3379632f1606ede9ed158c649ca7705892f7d2 Mon Sep 17 00:00:00 2001 From: Aferdita Muriqi Date: Tue, 30 Jan 2024 21:16:31 -0500 Subject: [PATCH] checks viewport parsing if it already contains "px" in height and width --- src/navigator/IFrameNavigator.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/navigator/IFrameNavigator.ts b/src/navigator/IFrameNavigator.ts index 46c0e1d7..b6ee060f 100644 --- a/src/navigator/IFrameNavigator.ts +++ b/src/navigator/IFrameNavigator.ts @@ -2576,8 +2576,12 @@ export class IFrameNavigator extends EventEmitter implements Navigator { return obj; }, {}); if (parseInt(obj["height"]) !== 0 || parseInt(obj["width"]) !== 0) { - height = obj["height"] + "px"; - width = obj["width"] + "px"; + height = obj["height"].endsWith("px") + ? obj["height"] + : obj["height"] + "px"; + width = obj["width"].endsWith("px") + ? obj["width"] + : obj["width"] + "px"; } } }