Add support for adding calibre to the homescreen on Android and iOS devices

This commit is contained in:
Kovid Goyal 2017-05-29 11:42:09 +05:30
parent 1cf008ab2a
commit 6c670b22a4
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 7 additions and 4 deletions

View File

@ -5,9 +5,11 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="robots" content="noindex"> <meta name="robots" content="noindex">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="icon" type="image/png" href="favicon.png"> <link rel="icon" sizes="256x256" type="image/png" href="favicon.png">
<link rel="apple-touch-icon" href="apple-touch-icon.png"> <link rel="apple-touch-icon" sizes="256x256" href="apple-touch-icon.png">
</head> </head>
<body> <body>
<div id="page_load_progress"> <div id="page_load_progress">

View File

@ -62,10 +62,11 @@ def margin_elem(sd, which, id, onclick):
) )
if onclick: if onclick:
ans.addEventListener('click', onclick) ans.addEventListener('click', onclick)
if is_ios and which is 'margin_bottom' and not /CriOS\//.test(window.navigator.userAgent): if is_ios and which is 'margin_bottom' and not window.navigator.standalone and not /CriOS\//.test(window.navigator.userAgent):
# On iOS Safari 100vh includes the size of the navbar and there is no way to # On iOS Safari 100vh includes the size of the navbar and there is no way to
# go fullscreen, so to make the bottom bar visible we add a margin to # go fullscreen, so to make the bottom bar visible we add a margin to
# the bottom bar. CriOS is for Chrome on iOS. # the bottom bar. CriOS is for Chrome on iOS. And in standalone
# (web-app mode) there is no nav bar.
ans.style.marginBottom = '25px' ans.style.marginBottom = '25px'
return ans return ans