WB-530: Add support for connect-web and connect-web protocol #141
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.
Support for connect-web
Create a new script that adds a connect web interceptor to the window. This can be used when implementing connect-web clients.
Gotchas
In order to upgrade this plugin to manifest V3, we will need to make some breaking changes. This includes not injecting scripts into browsers as a string.
V3 guards against this, so we will need to inject it as a shared js file. I have done so with this new script, but this causes an issue where sometimes the script loads after the app. We don't have control over the order that these scripts load.
The solution is to attempt to use the interceptor if it exists on the client, and if it doens't then watch for our custom event to see if it is ready again. For connect web this can be done like this.
We will have to migrate the
grpc-web
script to do the same thing, later down the line, otherwise, chrome will take the extension down.