-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IconVariants: Correct spelling & address svg and empty icon_variants #775
base: main
Are you sure you want to change the base?
Conversation
Thought:
|
If an extension specifies Without having thought too much about it, I don't think we need to fallback to the @xeenon, do you know how this is handled in Safari? |
@oliverdunk We do record an warning / soft error if |
An extension without an icon is valid, so as the error handling mode I would prefer no icon over a hard error. I wouldn't mind falling back to icons for compatibility, since that would match the behavior of the extension in browsers that don't recognize icon_variants. I don't feel too strongly about this though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For browsers not supporting SVG icons falling back to manifest.icons would be great for webcompat. However doing so would make the case for icon_variants as a replacement for icons weaker.
Safari currently falls back to manifest.icons
in case manifest.action.icon_variants
is malformed, however it skips manifest.action.icons
. As @xeenon pointed out in #775 (comment) introducing the fallback would be a behavioural change.
@@ -166,10 +166,10 @@ effectively have a wild-card for `color_schemes`. For example, `["*"]` is valid. | |||
**Misc** | |||
1. If the top-level `icon_variants` key is provided, the top level `icons` key | |||
will be ignored. | |||
1. `icon_variants` will not cause an error in the event that it is invalid. | |||
1. `icon_variants` will not cause an error if it's invalid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. `icon_variants` will not cause an error if it's invalid. | |
1. `icon_variants` will not cause hard errors if no icon groups are found or specific icon groups have unknown properties. It may cause a hard error if icon groups are not of type object. |
Instead, only the faulty icon group(s) will be ignored, with an optional | ||
warning. Warnings are preferred over errors because they're more adaptable to | ||
changes in the future. | ||
changes in the future. If none of the icon groups are valid, should this error? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes in the future. If none of the icon groups are valid, should this error? | |
changes in the future. If none of the icon groups are valid, agents are expected to fallback to the `icons` property in `manifest.json`. If `icons` is missing, agents are expected to use a default error and not give a hard error. |
This behaviour matches the current Safari implementation and reliefs extension authors from having to declare additional fallbacks in icon_variants
for browsers which do not support SVG for example. We may want to revisit this in MV4+ when the icons
property might be deprecated/discontinued.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Safari does not fallback to icons
. We have separate fallback to the containing app's icon if we can't get the icon from icon_variants
/ icons
. I would be fine adding fallback to icons
but it would require a change in our current shipping behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xeenon thanks for clarifying. You are right. In my tests, invalid manifest.action.icon_variants
would fallback to manifest.icons
if invalid. Which led me to the false conclusion this also happens for manifest.icon_variants
. In that case this is up for discussion once again. For browsers not supporting SVG icons falling back to manifest.icons would be great for webcompat. However doing so would make the case for icon_variants
as a replacement for icons
weaker.
@@ -200,7 +200,8 @@ starting with smaller sizes if available, retreating to the nearest larger size. | |||
1. The `"16"` is a size in `{"16": "icon.png"}` and any number can be used as a | |||
size, per the browser’s icon requirements. The word `"any"` can also be used in | |||
place of a number to represent an icon that can be shown at any size (usually | |||
vector images). The icon size used by the browser will be determined as follows: | |||
vector images). Does that mean that "any" will only have an svg and not a png? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vector images). Does that mean that "any" will only have an svg and not a png? | |
vector images). |
As currently with the manifest.icons
key, you can already specify icons in a size not matching the size specified, I do not see a reason to not support the any
keyword for raster images.
This PR aims to address three questions before merge: