Closed Bug 1313567 Opened 8 years ago Closed 8 years ago

Accept an object as the "author" in manifest.json

Categories

(WebExtensions :: Compatibility, defect, P1)

51 Branch
defect

Tracking

(firefox49 unaffected, firefox50 unaffected, firefox51 unaffected, firefox52+ verified)

VERIFIED FIXED
mozilla52
Tracking Status
firefox49 --- unaffected
firefox50 --- unaffected
firefox51 --- unaffected
firefox52 + verified

People

(Reporter: petcuandrei, Assigned: andy+bugzilla)

References

Details

(Keywords: regression, Whiteboard: triaged)

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
Build ID: 20161027030211

Steps to reproduce:

I'm trying to install the attached extension.


Actual results:

I tried to install the extension but I keep getting "This add-on could not be installed because it appears to be corrupt"


Expected results:

I should have been able to install it. It works fine in Firefox 49 but it fails in Nightly.
I was able to install this exact addon in the past in Nightly alsi. It has not changed, the only thing changed was Firefox Nightly. I tried with a new profile and it still fails. I even unpacked it and signed it with "web-ext sign".
Here is the print screen I'm getting:
http://imgur.com/a/DzFVi
Reg range:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=2f033b5b7fd6e
aff5cc7a6e5209e52f0a77ee607&tochange=23887d112341a01d14e2a65b87b7a49601e17ed2

Andy McKay — bug 1282977 handle developer in manifest r=kmag

Andy, is this error expected after your patch in bug 1282977?
Blocks: 1282977
Component: Untriaged → WebExtensions: Untriaged
Flags: needinfo?(amckay)
Keywords: regression
Product: Firefox → Toolkit
The format of:

    "author": {
        "email": "andrei@ceata.org"
    },

Has never been valid as far as I'm aware, it's not documented and doesn't work in the latest Firefox or Chrome. The only difference is in the past it failed silently, now it doesn't it fails with (on the command line):

1477672110725	addons.webextension.<unknown>	ERROR	Loading extension 'null': Reading manifest: Error processing author: Expected string instead of {"email":"andrei@ceata.org"}

I think we should keep this open to make that error clearer to the add-on developer.
Flags: needinfo?(amckay)
Summary: This add-on could not be installed because it appears to be corrupt → Raise clearer error when we try to fall back to author in the manifest.
I've found 19 add-ons in dxr that use this format, it might make sense to ignore the author property if its not a string.
:/ Chrome doesn't actually document what this is supposed to be, but it looks like they accept an object like this. Since this is going to break existing extensions, we should try to get it fixed before the next merge.
Assignee: nobody → amckay
Severity: normal → blocker
Status: UNCONFIRMED → NEW
Component: WebExtensions: Untriaged → WebExtensions: Compatibility
Ever confirmed: true
Priority: -- → P1
Summary: Raise clearer error when we try to fall back to author in the manifest. → Accept an object as the "author" in manifest.json
Tracking 52+ since this affects 19 extensions and is deemed a blocker bug.
Whiteboard: triaged
Changed the version to v51 since DevEdition seems to be affected. There is another error message dough: "Firefox Developer Edition prevents this site from asking you to install software on your computer."

https://imgur.com/a/kFeJE

Stable (v49) and beta (v50) seem to be fine. I just tested them.
Version: 52 Branch → 51 Branch
Comment on attachment 8805659 [details]
bug 1313567 use author as fallback if its a string, otherwise ignore

https://reviewboard.mozilla.org/r/89384/#review88972

::: toolkit/mozapps/extensions/internal/XPIProvider.jsm:1007
(Diff revision 1)
>      // Use the raw manifest, here, since we need values with their
>      // localization placeholders still in place.
>      let rawManifest = extension.rawManifest;
>  
> -    let creator = rawManifest.author;
> +    // As a convenience, allow author to be set if its a string bug 1313567.
> +    let creator = typeof(rawManifest.author) === 'string' ? rawManifest.author : null;

If we're going to continue to accept this when it's a string, then we should keep the schema entry, but add `onError: "warn"`.

r=me with that change.
Attachment #8805659 - Flags: review?(kmaglione+bmo) → review+
Comment on attachment 8805659 [details]
bug 1313567 use author as fallback if its a string, otherwise ignore

https://reviewboard.mozilla.org/r/89384/#review88972

> If we're going to continue to accept this when it's a string, then we should keep the schema entry, but add `onError: "warn"`.
> 
> r=me with that change.

Ah that's cool, I somehow forgot about that, much nicer. Thanks.
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/bf766b897b73
use author as fallback if its a string, otherwise ignore r=kmag
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/bf766b897b73
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
I was able to reproduce the initial issue on Firefox 52.0a1 (2016-10-27) under Windows 10 64-bit.
Verified as fixed on Firefox 52.0a1 (2016-11-03) under Windows 10 64-bit and Ubuntu 16.04 32-bit. The webextension is successfully installed and the following warning appears in Browser Console:


1478185796773	addons.webextension.{37BC59A6-9C96-11E6-935F-F1E010FC8C42}	WARN	Loading extension '{37BC59A6-9C96-11E6-935F-F1E010FC8C42}': Reading manifest: Error processing author: Expected string instead of {"email":"andrei@ceata.org"}
Status: RESOLVED → VERIFIED
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: