From 3ba527c0adec8c12f30d2a1304fd62f180a5fbf4 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Tue, 11 Jun 2024 21:54:25 +0200 Subject: [PATCH] nit --- packages/playwright-core/src/server/webkit/wkPage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/playwright-core/src/server/webkit/wkPage.ts b/packages/playwright-core/src/server/webkit/wkPage.ts index 25b558a2251a8..8d441240bc803 100644 --- a/packages/playwright-core/src/server/webkit/wkPage.ts +++ b/packages/playwright-core/src/server/webkit/wkPage.ts @@ -715,7 +715,7 @@ export class WKPage implements PageDelegate { if (options.isMobile) { const angle = viewportSize.width > viewportSize.height ? 90 : 0; // Special handling for macOS 12. - const useLegacySetOrientationOverrideMethod = parseInt(os.release().split('.')[0], 10) <= 21; + const useLegacySetOrientationOverrideMethod = os.platform() === 'darwin' && parseInt(os.release().split('.')[0], 10) <= 21; promises.push(this._pageProxySession.send(useLegacySetOrientationOverrideMethod ? 'Page.setOrientationOverride' as any : 'Emulation.setOrientationOverride', { angle })); } await Promise.all(promises);