diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2017-11-24 16:23:12 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2017-11-24 16:23:12 +0100 |
commit | 5cb096ace6582bba06c9bc625c750d5a83dd18ea (patch) | |
tree | 26b309262e7c8f257c960d1204c37eb987dc865f | |
parent | 62bc23f7dd7be0f62dfb4d4bbccdb0586ff9ae8c (diff) | |
download | crocoite-5cb096ace6582bba06c9bc625c750d5a83dd18ea.tar.gz crocoite-5cb096ace6582bba06c9bc625c750d5a83dd18ea.tar.bz2 crocoite-5cb096ace6582bba06c9bc625c750d5a83dd18ea.zip |
Reset device metrics
-rw-r--r-- | crocoite/cli.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crocoite/cli.py b/crocoite/cli.py index 2a2c174..5db4329 100644 --- a/crocoite/cli.py +++ b/crocoite/cli.py @@ -326,6 +326,7 @@ def main (): Emulate different screen sizes, causing the site to fetch assets (img srcset and css, for example) for different screen resolutions. """ + cssPpi = 96 sizes = [ {'width': 1920, 'height': 1080, 'deviceScaleFactor': 1.5, 'mobile': False}, {'width': 1920, 'height': 1080, 'deviceScaleFactor': 2, 'mobile': False}, @@ -333,9 +334,11 @@ def main (): {'width': 1920, 'height': 1080, 'deviceScaleFactor': 4, 'mobile': False}, # just a few samples: # 1st gen iPhone (portrait mode) - {'width': 320, 'height': 480, 'deviceScaleFactor': 1.8, 'mobile': True}, + {'width': 320, 'height': 480, 'deviceScaleFactor': 163/cssPpi, 'mobile': True}, # 6th gen iPhone (portrait mode) - {'width': 750, 'height': 1334, 'deviceScaleFactor': 326/90, 'mobile': True}, + {'width': 750, 'height': 1334, 'deviceScaleFactor': 326/cssPpi, 'mobile': True}, + # and reset + {'width': 0, 'height': 0, 'deviceScaleFactor': 0, 'mobile': False}, ] for s in sizes: tab.Emulation.setDeviceMetricsOverride (**s) |