如何使用WebStorm进行Chrome扩展程序开发? [英] How do I use WebStorm for Chrome Extension Development?

查看:855
本文介绍了如何使用WebStorm进行Chrome扩展程序开发?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚买了WebStorm 5,到目前为止一直非常享受它的检测功能。在开发我的Chrome扩展程序时遇到的一个问题是,它无法识别 chrome 变量:





一种方法,我可以将 chrome 变量添加到Inspector中,以便它可以在我输入时自动完成。我猜我需要将Chromium添加为外部库,但我不确定从哪里开始。 第一次

第一次设置


  1. 打开设置对话框(文件> 设置

  2. 点击语言&安培;框架> Javascript >


  3. 点击下载

  4. 确保 TypeScript社区存根被选中
  5. 从列表中选择 chrome 快速输入 chrome 点击下载并安装 OK 关闭设置对话框。

  6. >






步骤2-6如下图所示:






在后续项目中



在任何后续项目中,您只需:


  1. 打开设置 code>对话框( File > 设置


  2. 点击语言&框架> Javascript > 再次


  3. 检查 chrome-DefinitelyTyped

  4. 点击确定


    步骤2-4如下所示:

    < img src =https://i.stack.imgur.com/3Rh2Q.pngalt =Webstorm截图>


    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:

    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.

    解决方案

    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:


    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进行Chrome扩展程序开发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆