improve is_portrait()

This commit is contained in:
2025-07-21 05:56:40 +03:00
parent 7c1cbc57a6
commit 59dfdfe297
+5 -1
View File
@@ -58,7 +58,11 @@ async def default_page_setup():
async def is_portrait():
width, height = await ui.run_javascript("return [window.screen.availWidth, window.screen.availHeight]")
try:
width, height = await ui.run_javascript("return [window.screen.availWidth, window.screen.availHeight]")
except TimeoutError:
return False
if width > height:
return False
return True