如何打包未签名的Firefox WebExtension? [英] How to package an unsigned Firefox WebExtension?

查看:501
本文介绍了如何打包未签名的Firefox WebExtension?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Mac上开发一个在FirefoxDeveloperEdition(不需要签名)上运行的扩展。我跟着你的第一个WebExtension指南和一切工作正常使用加载临时加载项。但是当我尝试打包并使用从文件安装附加组件进行安装时,它显示此附加组件无法安装,因为它似乎已损坏。
,也尝试使用 web-ext build 。它们都会以相同的错误提示结束。


更新2

我在 about:config 中设置了 xpinstall.signatures.required false。



我的firefox版本是:51.0a2(2016-10-17)(64-bit)

有没有人能够加载未签名的xpi?这是一个Firefox的错误?或只是我吗?

解决方案

如果您要安装 .xpi ,则需要提供一个ID。
将这个添加到你的manifest.json根目录中

$ $ $ $ $ $ $ $ $ $ $
id:borderify@mozilla.org,
}
}

没有特别详细的记录,特别是这个 a>页面会告诉您在Firefox中安装附件时,会为其分配一个随机生成的临时ID。但是,似乎只能安装 about:debugging - xpi安装仍然需要一个ID。这可能是任何字符串,因为你已经在DevEdition上运行它,无论如何都禁用检查。



不用说,在Firefox上就不行。打开浏览器控制台,通常会包含有关扩展安装错误的其他信息 - 下次可能会有用。


I'm trying to develop an extension to run on the FirefoxDeveloperEdition (which doesn't require signing) on mac.

I followed the "Your first WebExtension" guide and everything works fine when using the "Load temporary add-on". But when I try to package it and install it using the "install add-on from file", it shows "this add-on could not be installed because it appears to be corrupt".

I zip all the files (borderify.js, manifest.json, icons, without the container folder) and change the suffix to .xpi. Is this the correct way of packaging? some answers mention that there should be a "install.rdf" ?, if so, how can I create that file? it seems there is no guide on the docs.

UPDATE:

I've tried using the mac builtin "compress n items", xpi file, also tried using web-ext build, xpi file. they all end up with the same error alert.

UPDATE 2:

I've set xpinstall.signatures.required false in about:config.

My firefox version is: 51.0a2 (2016-10-17) (64-bit)

Is there anyone able to load the unsigned xpi? Is it a Firefox bug? or is it just me?

解决方案

If you want to install .xpi, you need to provide an id. Add this to your manifest.json root

"applications": {
  "gecko": {
    "id": "borderify@mozilla.org",
  }
}

It's not particularly well documented, specifically this page tells that "add-on will be assigned a randomly-generated temporary ID when you install it in Firefox.". However, that only seems to work for installing over about:debugging - xpi installation still requires an ID. It might be any string, since you've running it on DevEdition with disabled checks anyway.

Goes without saying, that would not work on release Firefox.

P.S: Ctrl-Shift-J will open a browser console that will usually contain additional information about the extension installation error - might be useful next time.

这篇关于如何打包未签名的Firefox WebExtension?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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