Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
499 views
in Technique[技术] by (71.8m points)

javascript - How do I use WebStorm for Chrome Extension Development?

I just bought WebStorm 5 and so far have been really enjoying its Inspection features. One hitch I've run in to when developing my Chrome extension is that it doesn't recognize the chrome variable:

Unresolved variable or type chrome

Is there a way I can add the chrome variable to the Inspector so that it can autocomplete as I type? I'm guessing I would need to add Chromium as an External Library but I'm unsure where to start.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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 chrome from the list (you can find it quickly by just typing chrome)

  6. Click Download and Install

  7. Click OK to close the Settings dialog.


Steps 2-6 illustrated below:

Webstorm Screenshot


In Subsequent Projects

In any subsequent project, you just:

  1. Open the Settings dialog again (File > Settings)

  2. Click Languages & Frameworks > Javascript > Libraries again

  3. Check chrome-DefinitelyTyped

  4. Click OK to close the dialog.


Steps 2-4 shown below:

Webstorm screenshot


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...