improve is_portrait()
This commit is contained in:
@@ -58,7 +58,11 @@ async def default_page_setup():
|
||||
|
||||
|
||||
async def is_portrait():
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user