vaibhavhrt / web-extension

Extension to help with creating chrome/firefox browser extensions.
https://marketplace.visualstudio.com/items?itemName=VaibhavVishal.web-extension
30 stars 1 forks source link

Support `browser` for Firefox extensions #144

Open danielrozenberg opened 4 years ago

danielrozenberg commented 4 years ago

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)

danielrozenberg commented 4 years ago

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 🙃

vaibhavhrt commented 4 years ago

@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

danielrozenberg commented 4 years ago

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...

vaibhavhrt commented 4 years ago

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