简体   繁体   English

创建可引导的扩展程序的可安装Firefox XPI

[英]Create installable Firefox XPI for bootstrapped extension

I downloaded from addons repository a Firefox extension (url shortener), unzipped it and reworked a little bit to use another shortener service - i changed already only a url of shortening service and some names in meta - nothing of vital importance. 我从插件存储库中下载了Firefox扩展程序(URL缩短器),将其解压缩并进行了一些修改,以使用另一种缩短器服务-我已经只更改了一个缩短器服务的URL和meta中的一些名称-至关重要。 If i try just to zip all directories and files as they are and try to install - installation fails with an alert 如果我只是尝试按原样压缩所有目录和文件并尝试安装-安装失败并显示警告

"This addon can't be installed - it could be corrupted" “此附加组件无法安装-可能已损坏”

I guess there are any troubles with zipping of it. 我想压缩它会遇到麻烦。 I'm even sure, that there is a zipping problem, cause i tried to unzip the original extension, than to zip it without code changes and to install - same error alert. 我什至可以肯定,存在压缩问题,原因是我尝试解压缩原始扩展名,而不是不进行代码更改就压缩它并安装-同样的错误警报。

Also the question is, how to create an installable XPI for the bootstrapped extension (it is: 同样的问题是,如何为自举扩展创建可安装的XPI(它是:

  • without .jar-file, 没有.jar文件,
  • with another directory structure, 与另一个目录结构,
  • installation withour restart). 重新启动安装)。

The structure of bootstrapped extension (which i have here) is: 自举扩展的结构(我在这里)是:

   /defaults
   /locale
   /resources
    harness-options.json
    locales.json
    bootstrap.js
    install.rdf
    options.xul

I use 7-zip, but it is no problem to use any another archiving software. 我使用7-zip,但是使用任何其他存档软件都没有问题。

Thank you for any advice! 感谢您的任何建议!

Evgeniy 叶夫根尼

Got it done! 完成了! Like it describes this answer https://stackoverflow.com/a/18992738/1992004 i zipped a whole folder, what led in error cause of a folder creation inside of archive. 像它描述了这个答案https://stackoverflow.com/a/18992738/1992004我压缩了整个文件夹,这导致了在存档内部创建文件夹的错误原因。 After i zipped only included subfolders, i got an installable xpi. 我只压缩了包含子文件夹的文件后,得到了可安装的xpi。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM