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

WebExtension Manifest Version 3 #4357

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

moritztim
Copy link
Contributor

Add support for Manifest V3, while preserving Manifest V2 support as well, based on the manifest_version property

I'm somewhat new to both JSON Schemas and the WebExtension spec, so this might be incomplete. I followed the V2 to V3 Migration guide and relied on the MDN docs.

@moritztim
Copy link
Contributor Author

Now I just need some test files.

@moritztim
Copy link
Contributor Author

There's a problem with the way I added properties conditionally, it's complaining that I'm adding extra properties which is forbidden by "additionalProperties": false. How do I do this then? I thought this only applied on instances, not the definition itself

@hyperupcall
Copy link
Member

hyperupcall commented Jan 16, 2025

There's a problem with the way I added properties conditionally, it's complaining that I'm adding extra properties which is forbidden by "additionalProperties": false. How do I do this then? I thought this only applied on instances, not the definition itself

I've experienced the same issue in the past. Unfortunately, I'm not sure how to fix this issue (I instead removed the conditional schema properties since they were non-essential in that particular case).

somehow I forgot to do this crucial change
@moritztim
Copy link
Contributor Author

Any pros know a fix? Otherwise I'll just have to rethink it a little bit to remove that edgecase

Comment on lines 1113 to 1117
"browser_style": {
"deprecated": true,
"description": "Do not set browser_style to true: its not support in Manifest V3 from Firefox 118. See Manifest V3 migration for browser_style.\n\nhttps://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Browser_styles#manifest_v3_migration",
"const": false
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've now included browser_style, even in v3. The docs do claim the whole property is unsupported in v3, however they also say you may set it to false, so I've added their deprecation message, marked the property deprecated (even tho that's not part of the current spec) and set it to "const": "false".

@moritztim
Copy link
Contributor Author

I was still getting a similar error, which is really infuriating but I'm using a workaround now.

I assumed this would have a $ref to common_action
@moritztim moritztim marked this pull request as ready for review January 21, 2025 13:08
@moritztim
Copy link
Contributor Author

There's a problem with the way I added properties conditionally, it's complaining that I'm adding extra properties which is forbidden by "additionalProperties": false. How do I do this then? I thought this only applied on instances, not the definition itself

I've experienced the same issue in the past. Unfortunately, I'm not sure how to fix this issue (I instead removed the conditional schema properties since they were non-essential in that particular case).

Someone should probably open an issue about this because there's no way that's intended behaviour. I don't know where to start with that tho, wouldn't even know what to call it.

Not specifying the default type should allow this to work
@moritztim
Copy link
Contributor Author

moritztim commented Jan 21, 2025

Now I've found a workaround that is completely faithful the mdn docs. 0b4b85c

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

Successfully merging this pull request may close these issues.

2 participants