Skip to content

new_audit: common PWA icon snafus #11762

@paulirish

Description

@paulirish

Feature request summary

While @adrianaixba was working on #11745, she spotted some imageErrors/iconErrors in the devtools frontend:
https://source.chromium.org/search?q=(image%7Cicon)Errors&sq=&ss=chromium%2Fchromium%2Fsrc:third_party%2Fdevtools-frontend%2Fsrc%2Ffront_end%2Fresources%2F

None of these are installability gating, but they may be interesting.

There are TEN extra things being manually checked by the App Manifest view in devtools:

  • Shortcut #${shortcutIndex} should include a 96x96 pixel icon
  • Icon src is not set
  • Icon URL '${icon['src']}' failed to parse
  • Icon ${iconUrl} failed to load
  • Icon ${iconUrl} does not specify its size in the manifest
  • Icon ${iconUrl} should specify its size as {width}x{height}
  • Icon ${iconUrl} dimensions should be square
  • Actual size (${image.naturalWidth}×${image.naturalHeight})px of icon ${iconUrl} does not match specified size (${width}×${height}px)
  • Actual width (${image.naturalWidth}px) of icon ${iconUrl} does not match specified width (${width}px)
  • Actual height (${image.naturalHeight}px) of icon ${iconUrl} does not match specified height (${height}px)

Some of these seem useful. I'm not sure we can determine all of them, as the naturalSize ones require us actually loading the icon asset.

Some commits adding these:

What is the motivation or use case for changing this?

Avoid common icon snafus. Presumably.

We could add a "PWA icon best practices-ish audit" that checks a few of these things? Alternatively, these checks perhaps should be upstreamed into the installable manager? Not sure.

I have no idea how common these errors are. Perhaps the commits that added them have useful background.

How is this beneficial to Lighthouse?

Good for PWA folks to get their icons on lock.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions