This repository was archived by the owner on Apr 28, 2020. It is now read-only.
Add support for Firefox to extension#225
Closed
lucacasonato wants to merge 6 commits intocoder:masterfrom
Closed
Conversation
Contributor
Author
|
There is no .prettierrc file or similar included, so I formatted it in a way that seemed to fit most. If there is a .prettierrc file anywhere that belongs to this it would be nice if this was added to the repo. |
Member
|
I think the old command @kylecarbs Could you please review this? |
Contributor
Author
kylecarbs
reviewed
Aug 8, 2019
deansheather
approved these changes
Aug 14, 2019
Member
deansheather
left a comment
There was a problem hiding this comment.
After the extension stuff is rolled back and an alias is added for the old command name this should be good to merge.
Thanks for the work you did in regards to moving the websocket to the background script, I didn't realize that this had already been done when I did it in the approved hosts PR.
Member
|
Working on this in a new PR. |
Merged
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Adding support for Firefox to the extension is relatively simple because both Chrome and Firefox use the WebExtensions API. In our case this means that the same code will work as long as you place the native host manifests into the correct directory for Firefox. I added this to the extension setup command.
Annoyingly Firefox handles its Content Security Policy differently to Chrome for extensions (https://bugzilla.mozilla.org/show_bug.cgi?id=1267027). In a nutshell this means that we can not call
ws://127.0.0.1:XXXXX/api/v1/runfrom the content script itself. This means that the ws needs to be opened in the background script, which can then proxy messages to the content script. I have implemented this too.I also changed the command to setup the native host manifests to
sail setup-extension(because it does both Chrome and Firefox).