-
Notifications
You must be signed in to change notification settings - Fork 56
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
Inconsistency: runtime.getManifest() and missing keys #400
Comments
Adding an example for an "empty field" and a "missing value" would be helpful as these aren't precise terms in extensions/JS. |
I spoke to @rdcronin about this. We are generally aligned that
This matches our expectation, and we don't plan to remove this API from content scripts.
I'm not certain what is meant here. Is it just that fields not specified by the developer aren't included?
This is an implementation detail, and part of how we store which language we have localized the manifest (and fields like name) to. It shouldn't be returned and we need to filter this out - great spot. I've filed a bug: https://issues.chromium.org/350350583
I wasn't able to reproduce this - are you still seeing it? |
Safari also localizes the result, so you should not see any |
I recently found out that Firefox does not return the manifest verbatim but it drops anything it doesn't support, that includes any items in the permissions array. An example is "contextMenus" on Firefox Android. Safari iOS limits itself to leaving |
@oliverdunk Seems the |
Oliver has replied to Back to this issue itself, there are some inconsistencies due to the lack of specifications. However, from a developer's perspective, I don't know of any real-world cases where developers have to rely on this method. Basically, manifest is just static data. In the meeting note, @bershanskiy said "Sometimes it's convenient to use this as feature detection for support of manifest keys.". If so, I think it would be better to provide a new method for it, such as |
Another difference is that Safari appears to append the unique install ID to the end of |
Background
runtime.getManifest()
lets extensions to retrieve their ownmanifest.json
contents (Chrome docs, MDN). At least in principle, since the retrieved data structure is actually a result of export of browser-internal data structure generated frommanifest.json
and other sources. This ticket aims to clarify the differences and reconciliate them.Details
Availability
runtime.getManifest()
availability in different contexts differs across browsers. In Chromium and Firefox,chrome.runtime.getManifest()
exists in content script contexts, but in Safari it does not.Using
null
orundefined
for empty fieldsChromium and Safari use missing values (which do not appear in
Object.keys()
list and evaluate toundefined
). Firefox usesnull
.Manifest
current_locale
memberChromium adds
current_locale
to manifest. Firefox does not. Safari 16.5 does not.Manifest
update_url
Chromium seemingly hides
update_url
.Other differences?
The text was updated successfully, but these errors were encountered: