如何打包Firefox和Chrome扩展 [英] How to package Firefox and Chrome extensions

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

问题描述



我已经在开发模式中下载并测试了FF和Chrome的helloworld示例扩展。



按照以下步骤在FF和chrome中正常工作,


  • / p>


    1. 提取示例扩展,并在 / mozilla / firefox / dev_user / helloworld @ mozilla中添加一个文件我的FF版本是12.0,我改变了和提取的文件夹路径。

    2. < em:maxVersion> 到< >
      在Chrome浏览器中:

      重新启动FF并进行测试,
      $ b


      1. 提取样本扩展名

      2. 选择工具>扩展


      3. Checked Developer模式

      4. 点击Load unpacked extension按钮
      5. 出现并选择对话框e xtracted示例扩展文件夹路径


      6. 扩展程序已添加,完美工作。




现在我想知道如何打包这些扩展?我的意思是点击扩展应该直接在浏览器中安装的包,而不是按照上面的步骤。

好主意一次提出四个问题。让我们尝试回答所有问题:

lockquote

如何打包Firefox扩展?

您可以按照官方文档 (一个Firefox XPI包只是一个ZIP压缩文件)。

lockquote

如何打包Chrome扩展?


您可以按照官方文档

a>。
$ b


如何确保Firefox扩展可以从网站安装?


blockquote>

这个问题已经被回答了


如何确保Chrome扩展程序可以从网站安装吗?


你不能。目前的Chrome版本使得从第三方网站安装扩展程序变得非常复杂。您最好的选择是将您的扩展程序上传到 Chrome网上应用店(作为扩展文件的ZIP存档,而不是一个正确的包 - Chrome网上应用店为你创建的包)。扩展程序位于Chrome网上应用店后,即可使用内嵌安装以简化与您的扩展相关联的网站的安装。


I am new to Firefox and Chrome extension development.

I have downloaded and tested helloworld sample extension in both FF and Chrome in development mode.

Followed the following steps to work properly in FF and chrome,

  • In FF

    1. Extracted the sample extension, and added one file in /mozilla/firefox/dev_user/helloworld@mozilla.doslash.org and given extracted folder path.

    2. My FF version is 12.0 and I changed the<em:maxVersion> to 12.0.* in install.rdf file.

    3. Restarted FF and tested, it worked fine.

  • In Chrome:

    1. Extracted the sample extension

    2. Choose Tools > Extensions

    3. Checked Developer mode

    4. Click the Load unpacked extension button

    5. Dialog appears and selected extracted sample extension folder path

    6. Extension is added and works perfectly.

Now I would like to know how to package these extensions? I mean on clicking the package that extension should install directly in the browser instead of following the above steps.

解决方案

It's generally not a good idea to ask four questions at once. Let's try to answer all your questions:

How do I package a Firefox extension?

You follow the official documentation (a Firefox XPI package is simply a ZIP archive).

How do I package a Chrome extension?

You follow the official documentation.

How do I make sure a Firefox extension can be installed from a website?

That question is already answered elsewhere.

How do I make sure a Chrome extension can be installed from a website?

You cannot. Current Chrome versions make it very complicated to install extensions from third-party sites. Your best bet is to upload your extension to the Chrome Web Store (as a ZIP archive of extension files, not a proper package - Chrome Web Store creates the package for you). Once the extension is in the Chrome Web Store you can use inline installation to simplify installation from the website associated with your extension.

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

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