vaibhavhrt / web-extension

Extension to help with creating chrome/firefox browser extensions.

Home Page:https://marketplace.visualstudio.com/items?itemName=VaibhavVishal.web-extension

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support `browser` for Firefox extensions

danielrozenberg opened this issue · comments

Firefox extensions use browser, not chrome (though it supports both, MDN encourages using browser)
I tried just renaming all instances of chrome in the the files to browser but that didn't work - which is too bad because I wanted to send you a PR instead of filing an issue :)

Activating extension 'VaibhavVishal.web-extension' failed: Cannot find module '.browser/browserCompletionItemProvider'
Require stack:
- /home/daniel/.vscode/extensions/vaibhavvishal.web-extension-0.1.0/out/completionItemProviders.js
- /home/daniel/.vscode/extensions/vaibhavvishal.web-extension-0.1.0/out/extension.js
- /usr/share/code/resources/app/out/vs/loader.js
- /usr/share/code/resources/app/out/bootstrap-amd.js
- /usr/share/code/resources/app/out/bootstrap-fork.js

(yes I also renamed every file containing the name chrome to browser)

Update: it worked when I cloned your repo and did the same change. It just didn't work when I changed it in the already-compiled extension 🙃

@danielrozenberg does both chrome & firefox extensions supports browser?
I haven't looked at the project for a while, I will take a look on weekend

Chrome only supports chrome, Firefox supports browser and chrome (the latter is an alias to the former), other browsers (Edge, Safari) support browser, I don't know if they support chrome too...

hmm, in that case I will try to add autocomplete for both chrome & browser