New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 722615 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

A2HS banner shown with empty title on site with manifest name ""

Project Member Reported by owe...@chromium.org, May 15 2017

Issue description

In Clank 58.0.3029.83, I'm seeing an A2HS banner with a blank title on forbes.com

Just looked into their manifest, they have name: "", short_name: "Forbes".

Pressing 'Add to Home screen' button results in icon getting added with name "Forbes", but I presume we should either:

1) Be using the short_name in the banner since it has some content
2) Refuse to show the banner since name is invalid.
 

Comment 1 by piotrs@chromium.org, May 16 2017

I assume they left the name blank in order to have the name blank in the splash screen. I think this hack is harmless and even useful. At least it's better than rolling out now a quick manifest declaration saying "no-name-in-the-manifest".

Given all of above, I think (2) is the solution. To be more precise I think we should fall back to short_name if name is empty. Owen, do you have an opinion on this?
I think you meant (1) as your text doesn't match Owen's description for (2). Can you clarify?

Comment 3 by piotrs@chromium.org, May 16 2017

Correct, I meant (1), thanks for noticing!
Owner: dominickn@chromium.org
Status: Started (was: Available)
We already have a fallback to short_name if name is empty. Unfortunately, it looks like it only works if name is null (i.e. not provided) rather than explicitly set to the empty string.

This should be a pretty simple fix.
Project Member

Comment 5 by bugdroid1@chromium.org, May 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0b543dd3a72f7d63717ee4c99e74bf01902a1c7c

commit 0b543dd3a72f7d63717ee4c99e74bf01902a1c7c
Author: dominickn <dominickn@chromium.org>
Date: Tue May 23 04:14:21 2017

Properly fall back to manifest short_name when name is empty.

If a PWA includes a "name" field in their manifest, but explicitly sets
it to the empty string, it would have an app banner displayed with no
text, as well as no title on its splash screen.

This CL fixes the bug by properly checking if the "name" string is
empty, rather than just null. This check is already performed by the
InstallableManager in the process of determining whether or not a site
is a valid PWA. An additional test is added to ensure the correct
functionality.

BUG= 722615 

Review-Url: https://codereview.chromium.org/2900623002
Cr-Commit-Position: refs/heads/master@{#473806}

[modify] https://crrev.com/0b543dd3a72f7d63717ee4c99e74bf01902a1c7c/chrome/android/javatests/src/org/chromium/chrome/browser/banners/AppBannerManagerTest.java
[modify] https://crrev.com/0b543dd3a72f7d63717ee4c99e74bf01902a1c7c/chrome/browser/banners/app_banner_manager.cc
[add] https://crrev.com/0b543dd3a72f7d63717ee4c99e74bf01902a1c7c/chrome/test/data/banners/manifest_empty_name.json

Status: Fixed (was: Started)

Sign in to add a comment