如何使用 WebStorm 进行 Chrome 扩展开发? [英] How do I use WebStorm for Chrome Extension Development?
问题描述
我刚刚购买了 WebStorm 5,到目前为止我真的很喜欢它的检查功能.我在开发 Chrome 扩展程序时遇到的一个问题是它无法识别 chrome
变量:
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:
有什么方法可以将 chrome
变量添加到 Inspector 中,以便它可以在我键入时自动完成?我猜我需要将 Chromium 添加为外部库,但我不确定从哪里开始.
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.
推荐答案
首次设置
打开
设置
对话框(File
>Settings
)
点击Languages &框架
> Javascript
> 库
点击下载
确保选择了 TypeScript 社区存根
从列表中选择chrome
(只需输入chrome
即可快速找到)
Select chrome
from the list (you can find it quickly by just typing chrome
)
点击下载并安装
点击OK
关闭设置对话框.
<小时>
步骤 2-6 如下图所示:
Steps 2-6 illustrated below:
在任何后续项目中,您只需:
In any subsequent project, you just:
再次打开
Settings
对话框(File
>Settings
)
点击Languages &框架
> Javascript
> Libraries
再次
Click Languages & Frameworks
> Javascript
> Libraries
again
检查 chrome-DefinitelyTyped
点击OK
关闭对话框.
<小时>
步骤 2-4 如下所示:
Steps 2-4 shown below:
这篇关于如何使用 WebStorm 进行 Chrome 扩展开发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!