coder / sail

Deprecated: Instant, pre-configured VS Code development environments.
https://sail.dev
MIT License
629 stars 36 forks source link

Add support for Firefox to extension #225

Closed lucacasonato closed 4 years ago

lucacasonato commented 5 years ago

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/run from 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).

lucacasonato commented 5 years ago

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.

deansheather commented 5 years ago

I think the old command install-for-chrome-ext should be aliased to the new one, even if it gets a deprecated warrning.

@kylecarbs Could you please review this?

lucacasonato commented 5 years ago

@kylecarbs

deansheather commented 4 years ago

Working on this in a new PR.