Skip to content
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

Import schema for Firefox 92 #3872

Closed
rpl opened this issue Aug 23, 2021 · 8 comments · Fixed by #3873
Closed

Import schema for Firefox 92 #3872

rpl opened this issue Aug 23, 2021 · 8 comments · Fixed by #3873

Comments

@rpl
Copy link
Member

rpl commented Aug 23, 2021

Import schema for Firefox 92, which includes the following notable changes:

  • host_permissions support in manifest_version 3 extensions - Bug 1693385

The PR linked is also addition additional unit tests for the permissions and host_permissions manifest properties in manifest_version 2 and manifest_version 3 extensions, but (similarly to what we did for #3844) we may want to also explicitly QA verify the new linter version that will include the 92 schema on a sample of real extensions submitted to AMO, included some of those that were mixing manifest_version 3 manifest keys in a manifest_version 2 extension manifest.

@AlexandraMoga
Copy link

@rpl I've verified this issue with [email protected] and I have the following results:

  • MV2 with MV3 specific manifest keys - i.e. background/service_worker, host_permissions
ERRORS:

Code                      Message                 Description                                 File            Line   Column
JSON_INVALID              "/background/service…   Your JSON file could not be parsed.
                          _worker" is an
                          invalid additional
                          property
MANIFEST_FIELD_REQUIRED   "/background/page" is   See https://mzl.la/1ZOhoEN (MDN Docs) for   manifest.json
                          a required property     more information.
MANIFEST_FIELD_REQUIRED   "/background/scripts"   See https://mzl.la/1ZOhoEN (MDN Docs) for   manifest.json
                          is a required           more information.
                          property
JSON_INVALID              "/background" is not    Your JSON file could not be parsed.
                          a valid key or has
                          invalid extra
                          properties
WARNINGS:

Code                         Message                 Description                                 File            Line   Column
MANIFEST_FIELD_UNSUPPORTED   "/host_permissions"     "/host_permissions" is in a format not      manifest.json
                             is in a format not      supported in manifest versions < 3.
                             supported in manifest
                             versions < 3.
  • invalid host_permissions both for MV2 and MV3 - i.e. "foo" => there are several errors regarding accepted syntax:
Code           Message                                  Description                           File   Line   Column
JSON_INVALID   "/host_permissions/2" should be equal    Your JSON file could not be parsed.
               to one of the allowed values
JSON_INVALID   "/host_permissions/2" should match       Your JSON file could not be parsed.
               pattern
               "^(https?|wss?|file|ftp|\*)://(\*|\*\…
               .[^*/]+|[^*/]+)/.*$"
JSON_INVALID   "/host_permissions/2" should match       Your JSON file could not be parsed.
               pattern "^file:///.*$"
JSON_INVALID   "/host_permissions/2" is not a valid     Your JSON file could not be parsed.
               key or has invalid extra properties
JSON_INVALID   "/host_permissions/2" should match       Your JSON file could not be parsed.
               pattern
               "^resource://(\*|\*\.[^*/]+|[^*/]+)/.…
               *$|^about:"

In addition to that, I've also validated several popular extensions and didn't notice anything different in the validation results.

@rpl
Copy link
Member Author

rpl commented Sep 2, 2021

@AlexandraMoga I assume that the first group of linting results are from a manifest_version 2 extension and the second group from a manifest_version 3 one, is that right?

@AlexandraMoga
Copy link

@rpl, yes the first set of results are for a manifest_version 2 extension and the second results could be triggered both with a manifest_version 2 and 3.

@willdurand
Copy link
Member

@rpl, yes the first set of results are for a manifest_version 2 extension and the second results could be triggered both with a manifest_version 2 and 3.

@AlexandraMoga do you get the second results with manifest_version set to 2? host_permissions should be ignored for MV2.

@AlexandraMoga
Copy link

@willdurand yes, the same errors are received for an MV2 add-on. I can see a warning about host_permissions not being supported but the validation errors are still triggered.

Here is a complete set of results only for MV2

ERRORS:

Code           Message                 Description                           File   Line   Column
JSON_INVALID   "/host_permissions/2"   Your JSON file could not be parsed.
               should be equal to
               one of the allowed
               values
JSON_INVALID   "/host_permissions/2"   Your JSON file could not be parsed.
               should match pattern
               "^(https?|wss?|file|…
               ftp|\*)://(\*|\*\.[^…
               */]+|[^*/]+)/.*$"
JSON_INVALID   "/host_permissions/2"   Your JSON file could not be parsed.
               should match pattern
               "^file:///.*$"
JSON_INVALID   "/host_permissions/2"   Your JSON file could not be parsed.
               is not a valid key or
               has invalid extra
               properties
JSON_INVALID   "/host_permissions/2"   Your JSON file could not be parsed.
               should match pattern
               "^resource://(\*|\*\…
               .[^*/]+|[^*/]+)/.*$|…
               ^about:"
WARNINGS:

Code                         Message                 Description                              File            Line   Column
MANIFEST_FIELD_UNSUPPORTED   "/host_permissions"     "/host_permissions" is in a format not   manifest.json             
                             is in a format not      supported in manifest versions < 3.                                
                             supported in manifest                                                                      
                             versions < 3. 

@willdurand
Copy link
Member

@rpl in this case, it looks like a bug?

@willdurand
Copy link
Member

willdurand commented Sep 3, 2021

I uploaded the following manifest.json on -dev:

{
    "manifest_version": 2,
    "version": "2.0",
    "description": "A test extension from webext-generator.",
    // some comments
    "name": "apeckey-buttleah-reine",
    "permissions": [
        "\u003Call\u005Furls\u003E"
    ],
    "host_permissions": ["foo"]
}

Here are the validation results: https://addons-dev.allizom.org/en-US/developers/upload/54f21699a4734d7985a64428f04d1313

Screenshot 2021-09-03 at 11 46 49

@rpl
Copy link
Member Author

rpl commented Sep 3, 2021

@rpl in this case, it looks like a bug?

yes, it does, I created #3891 as a follow up to fix it (and tracked by the github issue #3888)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants