-
Notifications
You must be signed in to change notification settings - Fork 27
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
Use manifest v3 #458
Merged
Merged
Use manifest v3 #458
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
TODO:
|
Security update, see w3c/webextensions#637 (comment)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #412
Introduction
A chrome announced they will deprecate and disable extensions with manifest v2 soon. So we have to migrate to manifest v3.
Also, currently a custom translators runs in addon context, so its may use addon API that is potentially dangerous. We have to sandbox translators.
Manifest v3 status research
Currently manifest v3 is not production ready since
eval
function, does not support worker script and no have offscreen API. Additionally, a firefox makes a lot of permissions are optional, so it is not possible to request some permissions while install the addon, so as result user can't use translation for selected text, because it is necessary to click by addon icon to inject contentscript. Only one way to fix this problem is to create a special page that will explain the problem to user and will ask user to click on button that will request a permission, and open this page after install of addon that is bad UX. Here we may see how badly manifest v3 implemented in firefox - they decided that developers of firefox knows better which permissions for our addon are optional and which one is not.So it is bad idea to migrate on manifest v3. However, we forced to migrate on v3 at least for chromium.
Solution
We decided to move on manifest v3 for a chrome and stay on v2 for another browsers.
We have to implement some glue code to make it work for all browsers, but currently this is the only way to keep all features enabled for all users.
Changes
postMessages
. Iframe evaluates user provided code in secure context and return results withpostMessages
. Afetch
function in sandboxed iframe is replaced to proxy that make request in parent frame (so it is possible to fetch any origin with any CSP) and then returnResponse
back withpostMessage
.side changes
src/_locales/gu/messages.json
Testing