在开发过程中调试Firefox插件的最快方法

编程入门 行业动态 更新时间:2024-10-26 21:27:11
本文介绍了在开发过程中调试Firefox插件的最快方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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.

额外提示:

  • 配置文件(dev),而其他firefox配置文件已打开,并且调试器已打开:

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

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

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

查看重新启动插件(节省时间)。

更多推荐

在开发过程中调试Firefox插件的最快方法

本文发布于:2023-07-22 04:04:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1183987.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:过程中   插件   最快   方法   Firefox

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!