Skip to content

Commit c562c44

Browse files
author
Pablo Vieira
committed
feat(pwa): optimize full screen for ios
1 parent baf9ce8 commit c562c44

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

_includes/head.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@
1010
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
1111
<link rel="manifest" href="/manifest.json">
1212
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#bf921e">
13-
<meta name="apple-mobile-web-app-title" content="{{ site.app_name }}">
1413
<meta name="application-name" content="{{ site.app_name }}">
1514
<meta name="theme-color" content="{{ site.meta.theme_color }}">
1615

16+
<meta name="apple-mobile-web-app-title" content="{{ site.app_name }}">
17+
<meta name="apple-mobile-web-app-capable" content="yes">
18+
<meta name="apple-mobile-web-app-status-bar-style" content="black">
19+
1720
{% capture page_title %}{% if page.title %}{{ " &middot; pv8.io" | prepend: page.title }}{% else %}{{ site.title }}{% endif %}{% endcapture %}
1821
{% capture page_description %}{% if page.excerpt %}{{ page.excerpt | markdownify | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.meta.description }}{% endif %}{% endcapture %}
1922
{% capture url %}{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}{% endcapture %}

_includes/ios-fullscreen.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<script type="text/javascript">
2+
$(document).ready(function(){
3+
// PWA: iOS web full screen seamless experience
4+
if(window.navigator.standalone == true) {
5+
// all links remain in web app mode
6+
$('a').click(function() {
7+
window.location = $(this).attr('href');
8+
return false;
9+
});
10+
}
11+
});
12+
</script>

_layouts/default.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,7 @@
2222
{% include analytics.html %}
2323

2424
{% include service-worker.html %}
25+
26+
{% include ios-fullscreen.html %}
2527
</body>
2628
</html>

0 commit comments

Comments
 (0)