-
Notifications
You must be signed in to change notification settings - Fork 79
Upgrade extension to manifest v3 #549
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
Comments
Copy-pasting below some of what I wrote down in an Element channel: Some contextSo, right now, the substrate-connect library works as follows:
The problemThe substrate-connect extension uses manifests v2. There is now a manifest v3, and it is way more restrictive. Extensions that use manifests v2 will stop working the 1st of January 2023. In other words, if we do nothing, the substrate-connect extension will stop working at the end of the year. Manifest v3 do not allow long-lived scripts in extensions. You can have scripts, but they are started "on demand" and get terminated afterwards. For example: a web page can send a message to the extension, a script starts, handles the message, and once it's done the script ends and everything the script might have created (such as WebSocket connections) gets killed. Another read: https://www.eff.org/deeplinks/2021/12/chrome-users-beware-manifest-v3-deceitful-and-threatening What is possibleSo what is it still possible to do in an extension? What an extension can now do is act as a "shared programmable cache". An extension can basically intercept HTTP requests and override their responses (for example, to load the response from the browser's storage instead), and can receive messages from web pages and send back answers, and that's roughly it. It is still possible to run long processes. For example, an extension can start downloading data from the Internet in the background and store it, but it seems that this comes and will always come with limitations. Right now it seems that a script will always get killed after 5 minutes no matter what. 5 minutes seems long enough, but this is an implementation detail we can't rely on in the long term, and Google might decide that since they're against long-running script they would add more restrictions. How do we adjust substrate-connect?Given the constraint of not having long-running scripts, it's clear that we can't run the blockchain node in the extension anymore. We can redesign the extension to handle the download part of point 1. (in the list at the start of this message), and point 4. Points 2 and 5, however, go out of the window. More detailsI think that we should run an instance of smoldot in the content script of each individual web page that wants to connect to a chain. This means, for example, that a smoldot instance in a content script can sync a chain, then send its sync status to the extension, which then sends it to the other content scripts. One possibility we have could be to start one instance of smoldot in each content script and have each of these smoldot instances connect to each other as if they were part of the peer-to-peer network, and exchange "networking" messages through the extension. |
Based on the timeline given by Chrome concerning Manifest V2 support timeline, 2021 is the last year that new manifest v2 extensions will be accepted (starting January 17, 2022).
Thus it is probably needed to update extension to v3
Potential blocking problems to switching to manifest v3:
The text was updated successfully, but these errors were encountered: