Firefox扩展自动安装 [英] Firefox extension auto installation
问题描述
我正在创建一个Firefox扩展,我有一个扩展名文件的文件夹。每次我想测试我必须压缩它,将扩展名更改为.xpi,将其拖放到Firefox窗口,等待3秒钟,单击安装按钮,然后重新启动浏览器。
我已经创建了一个批处理文件来压缩文件夹并更改扩展名,但是可以用脚本完全重新安装它,而无需拖放程序?
- 转到
about:debugging
并加载您的扩展程序作为临时插件。只要点击一下鼠标,就可以重新加载,无论何时进行更改 - 无论是打包还是打包目录,都可以。 - 使用 web-ext命令行工具,它可以将您的扩展安装为临时插件从命令行。它还可以观察扩展文件的变化并自动重新加载。
$ b $ hr
$ b原始回答仅供参考,仅适用于Firefox 56.
其实,这就是为什么我创建了 Extension Auto-Installer 。在测试浏览器中安装扩展,并将以下内容添加到批处理脚本中:
wget --post-file = extension.xpi http:// localhost:8888 /
这会自动在您的浏览器中安装您的扩展程序,一定。如果需要签名扩展,它将提供将扩展安装为当前浏览器会话的临时插件。
当您似乎使用Windows时,您需要 Wget for Windows 或类似的命令行工具。
I'm creating a Firefox extension and I have a folder with files of the extension. Every time I want to test in I have to zip it, change the extension to .xpi, drag&drop it to Firefox window, wait for 3 seconds, click install button and restart the browser.
I've made a batch file that zips the folder and changes the extension, but is it possible to reinstall it completely with the script, without drag&drop routine?
解决方案Edit (2017-06-25): As of Firefox 57, classic extensions (including Extension Auto-Installer mentioned below) will stop working. This means that your choices are now:
- Go to
about:debugging
and load your extension as a temporary add-on. This will allow reloading it with a single click, whenever you make changes - either to a package or to an unpacked directory, both are possible. - Use the web-ext command line tool, it can install your extension as a temporary add-on from the command line. It can also watch extension files for changes and reload automatically.
Original answer for reference, will only work up to Firefox 56.
Actually, that's why I created Extension Auto-Installer a while ago. Install the extension in your test browser and add the following to your batch script:
wget --post-file=extension.xpi http://localhost:8888/
This will automatically install your extension in the browser and restart it if necessarily. If signing extensions is required, it will offer to install the extension as a temporary add-on, for the current browser session only.
As you seem to be using Windows, you will need Wget for Windows or a similar command line tool.
这篇关于Firefox扩展自动安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- Go to