“apple-mobile-web-app-title” on Android

2019-03-24 16:45发布

is there an equivalent to iOS 6 meta tag apple-mobile-web-app-title for android web-applications? Something that gives you the possibility to define a long title and a short title.

<title>Long name</title>
<meta name="apple-mobile-web-app-title" content="Short name">

3条回答
我只想做你的唯一
2楼-- · 2019-03-24 17:09

One way you can do this is by using javascript to detect the mobile browser and then change document.title to a shorter title:

if (navigator.userAgent.match(/(iPad|iPhone|iPod|Android|Silk)/gi))
   document.title = "Short Title";
查看更多
不美不萌又怎样
3楼-- · 2019-03-24 17:16

Chrome has added support for JSON-based manifest file for your web app since M39. The field short_name is equivalent to Safari's apple-mobile-web-app-title in that it would be preferred where there is limited space to display the full name, e.g. app launcher.

W3C spec for short_name field in web app manifest file:

The short_name member is a string that represents a short version of the name of the web application. It is intended to be used where there is insufficient space to display the full name of the web application.

查看更多
冷血范
4楼-- · 2019-03-24 17:24

This is possible using the "application-name" meta tag. However it only appears to work with chrome. Firefox and the android browser don't use the title tag

<head> ...  <meta name="application-name" content="Awesome App!"> ...  </head>

From, Usage in web applications section
http://w3c-webmob.github.io/installable-webapps/

查看更多
登录 后发表回答