在开发过程中调试Firefox插件的最快方法 [英] Fastest way to debug Firefox addons during development

查看:107
本文介绍了在开发过程中调试Firefox插件的最快方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

调试Firefox插件是一个缓慢的过程:(1)使用构建脚本(3)将JS编辑器(2)包中的源代码编译成XPI(3)拖动到Firefox中安装(4)重新启动Firefox(5)打开JavaScript调试器

Debugging a Firefox addon is a slow process: (1) edit source code in a JS editor (2) package into XPI using a build script (3) drag into Firefox to install (4) restart Firefox (5) open the JavaScript Debugger

我们可以加快进程吗?喜欢将其安装到Firefox中,无需重新启动,也可以将构建脚本配置到Firefox中。

Can we speeden up the process? Like install it into Firefox without a restart, or configure the build script to install it into Firefox as well?

推荐答案

要找到您的个人资料文件夹。找到它后,进入名为extensions的文件夹,然后找到您正在处理的加载项的文件夹。用相同名称的文件替换该文件夹(减去 .xpi ,如果是该名称的一部分),并且文件内部将添加到源目录的完整路径-上。

You'll want to locate your profile folder. Once you find it, go into the folder called 'extensions', and then locate the folder for the add-on you are working on. Replace that folder with a file of the same name (minus .xpi if that's part of the name), and inside the file place the full path to your source directory of the add-on.

在Linux和Mac中,它将如下所示:

In Linux and Mac, that'll look like:

/full/path/to/yourExtension/

在Windows上:

C:\full\path\to\yourExtension\

记住尾部的斜杠,并注意额外的空格。

Remember the trailing slash and beware of extra whitespace.

只要你不要在你的add-您将不再需要重建(这里覆盖了更多深度

As long as you don't use jar files inside your add-on, you will no longer have to rebuild (this is covered in a bit more depth here).

此外,您还需要设置 nglayout.debug.disable_xul_cache 为true。对于编辑xul或js文件,您只需要打开一个新窗口即可查看更改,而不是重新启动应用程序。您可能会发现有用的其他偏好设置

Additionally, you'll want to set nglayout.debug.disable_xul_cache to true. For edits to xul or js files, you'll just have to open up a new window to see your changes instead of restarting the application. There are other preferences here that you may find useful as well.

额外提示:


  • 启动具有某个配置文件的Firefox (dev),而其他firefox配置文件是打开的,调试器已经开启了:

  • Starting firefox with a certain profile (dev), while other firefox profile is open and with the debugger already on:

C:\Program Files(x86)\Mozilla Firefox\firefox。 exe-no-remote -P dev -jsconsole

"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -no-remote -P dev -jsconsole

查看 restart addon (节省时间)。

这篇关于在开发过程中调试Firefox插件的最快方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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