Firefox AddOn (webextension): need advice for Project / IDE config, maybe plugins or support libs
Hi,
I'm working on a project for a Firefox AddOn using the webextension technology. As I started with existing sources, I used "Project" -> "New Project from existing sources" for setting up the project.
Now, I can edit the JavaScript and most things work, but a few things appear to be missing:
- I get deprecation warnings in code I copied from the webextensions docs and examples directly from MDN, e.g for
browser.runtime.onMessage.addListener(listener)
which is correct, according to https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onMessage
- There are no autocompletions for the webestensions API types, e.g. https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/Tab
What I'm looking for is some advice to configure the project or the IDE. Currently I'm using IDEA Ultimate, but I could switch to another product if needed, as I signed up for the "All Products Package".
Maybe there is an IDEA plugin I did not find, or a support library I can add to the project ?
By "support library", I don't mean a JavaScript library I can use in the project itself, like JQuery. I mean something that provides IDEA with autocomplete information, i.e. someting that represents the runtime types.
If there is no such thing, I think I can live without it, but if there is, I'd like to use it.
Thanks and Regards,
Markus
Please sign in to leave a comment.
>By "support library", I don't mean a JavaScript library I can use in the project itself, like JQuery. I mean something that provides IDEA with autocomplete information, i.e. someting that represents the runtime types.
IDEA uses javascript libraries/Typescript stubs to provide autocomplete information. See https://blog.jetbrains.com/webstorm/2014/07/how-webstorm-works-completion-for-javascript-libraries/
I believe that installing webextension typings would help: npm i @types/firefox-webext-browser
Adding "@types/firefox-webext-browser" as external library helped. thanks.