IntelliJ Firefox Web Extensions Development
Asked Answered
G

1

12

Am learning how to use the Firefox Web Extensions API, and am using IntelliJ.

IDE: underlined JS: browser.browserAction.onClicked.addListener(() => { browser.tabs.executeScript(…

Is there a way to get code completion / suggestions for the API?

I followed the steps in the answer below, but there doesn't seem to be a complete one for Firefox.

https://mcmap.net/q/143956/-how-do-i-use-webstorm-for-chrome-extension-development

Granger answered 10/2, 2017 at 22:10 Comment(0)
L
15

Firefox WebExtension type stubs were added recently (Nov 2017) under the name firefox-webext-browser. The steps in the answer you linked are now valid (relevant changes in bold):

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.
Lepidote answered 1/1, 2018 at 18:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.