IntelliJ Firefox Web 扩展开发

IntelliJ Firefox Web Extensions Development

正在学习如何使用 Firefox Web Extensions API,并且正在使用 IntelliJ。

有没有办法获得 API 的代码完成/建议?

我按照以下答案中的步骤操作,但似乎没有完整的 Firefox 答案。

最近(2017 年 11 月)在名称 firefox-webext-browser 下添加了 Firefox WebExtension 类型存根。您链接的答案中的步骤现在有效(相关更改以粗体显示):

First time setup

  1. Open the Settings dialog (File > Settings)
  2. Click Languages & Frameworks > Javascript > Libraries
  3. Click Download
  4. Make sure TypeScript community stubs is selected
  5. Select firefox-webext-browser from the list (you can find it quickly by just typing firefox-w)
  6. Click Download and Install
  7. Click OK to close the Settings dialog.

In Subsequent Projects

  1. Open the Settings dialog again (File > Settings)
  2. Click Languages & Frameworks > Javascript > Libraries again
  3. Check @types/firefox-webext-browser
  4. Click OK to close the dialog.