--- /dev/null
+<?php
+ use Friendica\Core\Config;
+
+ function manifest_content(App $a) {
+
+ $tpl = get_markup_template('manifest.tpl');
+
+ header('Content-type: application/manifest+json');
+
+ $touch_icon = Config::get('system', 'touch_icon', 'images/friendica-128.png');
+ if ($touch_icon == '') {
+ $touch_icon = 'images/friendica-128.png';
+ }
+
+ $o = replace_macros($tpl, array(
+ '$baseurl' => App::get_baseurl(),
+ '$touch_icon' => $touch_icon,
+ '$title' => Config::get('config', 'sitename', 'Friendica'),
+ ));
+
+ echo $o;
+
+ killme();
+
+ }
+?>
<link rel="apple-touch-icon" href="{{$touch_icon}}"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
+<link rel="manifest" href="{{$baseurl}}/manifest" />
<script>
// Prevents links to switch to Safari in a home screen app - see https://gist.github.com/irae/1042167
(function(a,b,c){if(c in b&&b[c]){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(chref=d.href).replace(e.href,"").indexOf("#")&&(!/^[a-z\+\.\-]+:/i.test(chref)||chref.indexOf(e.protocol+"//"+e.host)===0)&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone");
--- /dev/null
+{
+ "name": "{{$title}}",
+ "start_url": "{{$baseurl}}",
+ "display": "standalone",
+ "description": "A Decentralized Social Network",
+ "icons": [{
+ "src": "{{$baseurl}}/{{$touch_icon}}"
+ }]
+}
<link rel="apple-touch-icon" href="{{$touch_icon}}"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
+<link rel="manifest" href="{{$baseurl}}/manifest" />
<script>
// Prevents links to switch to Safari in a home screen app - see https://gist.github.com/irae/1042167
(function(a,b,c){if(c in b&&b[c]){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(chref=d.href).replace(e.href,"").indexOf("#")&&(!/^[a-z\+\.\-]+:/i.test(chref)||chref.indexOf(e.protocol+"//"+e.host)===0)&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone");