Closed Chersquwn closed 1 year ago
@Chersquwn string for default icon is not supported in manifest v3, see https://json.schemastore.org/chrome-manifest. @jacksteamdev I guess the manifest validation could pick it up though right?
@filipw01 But I don't see any migration guide about "default icon not support string type" on the chrome developer website.In the official examples, there are also default icons that use string. Like this,
and this, https://github.com/GoogleChrome/chrome-extensions-samples/blob/main/examples/bookmarks/manifest.json
In that case, the example has an error. action
is a new thing and it's specified in a migration guide https://developer.chrome.com/docs/extensions/mv3/intro/mv3-migration/#action-api-unification
It is specified only as an object here https://developer.chrome.com/docs/extensions/reference/action/
This key is a dictionary of sizes to image paths
@Chersquwn Thanks for reporting this discrepancy between the Chrome developer docs and CRXJS! I downloaded and tested the sample extension with default_icon
as a string and it does work in chromium@v102.
I'm open to adding support for icons as strings. PRs are welcome!
What @filipw01 said is best practice. Chrome uses different icon sizes based on the user's screen resolution, and a low-res icon looks unprofessional. I don't know what happens to a high-res icon in a lower res setting.
I'm unsure what the Chrome Web Store would do with an extension like this. Would it pass the review?
The JSON schema is great, it provides IntelliSense as well as validation. I've added validation to the roadmap.
VSCode instructions for using JSON schemas: https://code.visualstudio.com/docs/languages/json#_json-schemas-and-settings
Build tool
Vite
Where do you see the problem?
Describe the bug
It seems
default_icon
inaction
does not support string. Ifdefault_icon
uses string, it will be split into'i','c','o','n','s','/'...
, such asicons/
.https://github.com/crxjs/chrome-extension-tools/blob/main/packages/vite-plugin/src/node/helpers.ts#L71
Reproduction
Logs
System Info
Severity
annoyance