15

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">
Hannes
  • 150
  • 1
  • 1
  • 7

4 Answers4

6

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/

rostalof
  • 61
  • 1
  • 3
2

Create a JSON file called site.webmanifest, that looks like this:

{
  "name": "Long name",
  "short_name": "Short name",
  "icons": [
    {
      "src": "/android-chrome-192x192.png",
      "sizes": "192x192",
      "type": "image/png"
    },
    {
      "src": "/android-chrome-512x512.png",
      "sizes": "512x512",
      "type": "image/png"
    }
  ],
  "theme_color": "#ffffff",
  "background_color": "#ffffff",
  "display": "standalone"
}

Then add it to your HTML like this:

    <link rel="manifest" href="/site.webmanifest">

The "icons" part is irrelevant to your question, but you should probably include them as well (and actually make those icon files). I got this from this article: https://dev.to/masakudamatsu/favicon-nightmare-how-to-maintain-sanity-3al7

Boris Verkhovskiy
  • 14,854
  • 11
  • 100
  • 103
0

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.

ricca
  • 71
  • 1
  • 5
0

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";
Jeff Baker
  • 1,492
  • 1
  • 12
  • 15