Firefox扩展自动安装 [英] Firefox extension auto installation

查看:160
本文介绍了Firefox扩展自动安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个Firefox扩展,我有一个扩展名文件的文件夹。每次我想测试我必须压缩它,将扩展名更改为.xpi,将其拖放到Firefox窗口,等待3秒钟,单击安装按钮,然后重新启动浏览器。



我已经创建了一个批处理文件来压缩文件夹并更改扩展名,但是可以用脚本完全重新安装它,而无需拖放程序?

:从Firefox 57开始,经典扩展(包括下面提到的扩展自动安装程序)将停止工作。这意味着您的选择现在是:




  • 转到 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屋!

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