使用附加SDK来开发我的Firefox扩展有什么优点/缺点? [英] What are the advantages/disadvantages of using the Add-on SDK to develop my Firefox extension?

查看:146
本文介绍了使用附加SDK来开发我的Firefox扩展有什么优点/缺点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发(又一个)Firefox的密码管理器插件。我的插件需要:


  • 为每个密码字段添加两个上下文菜单项。

  • 选择菜单项时打开对话框或浮动面板。
  • 访问特定XPCOM组件的特定方法。
  • 填写密码字段。
  • 包含首选项窗口。
  • 与Firefox 4.0兼容



最好也是:


  • 在Firefox 3.5和3.6上运行。

    • 某些用户不会升级到最新版本。

    • Firefox 4.0不能在PowerPC Mac上运行。 >

    • 在Firefox 4.0上安装而不重新启动。

    • 允许本地化。 b


    我已经尝试了附加SDK(以前称为Jetpack),它使得开始开发变得非常容易。但是,我发现HTML不能轻易地创建本机查看对话框,而且SDK相当重量级。 (构建一个简单的扩展需要几千字节,包括一个XPCOM组件!)

    使用附加SDK来开发我的Firefox有什么好处和缺点延期?是否准备好严重的扩展开发?


    <
    Jetpack API暴露 rel =noreferrer>高级API 对于你提到的大部分内容:


    • 添加两个上下文菜单项

    • 浮动面板

    • 密码管理器API

    • 基于Jetpack的加载项无需重新启动。
      基于Jetpack的附加组件是未来的证明,因为高级API将保持不变
      为未来版本的FF。
    • 您可以使用一些社区开发的模块,以供SDK不公开的API使用。

    • 如果这不是你打算建立的最后一个扩展,那么有一个潜在的代码重用,
      通过构建第四方中提到的第三方模块(详见文档)

    • 支持移动FF发布1.0版的Addon-SDK,这可能意味着您的
      扩展名可以与FF的移动版本兼容,只需极少的努力就可以了。

    • Jetpack带有内置的单元测试框架。
    • 具有更好的安全模型,这将简化附加的审查过程。 Jetpack支持commonjs模块/包,这意味着一些代码可以从其他项目(如nodejs)借用

    • >



      缺点:$ b​​
      $ b



      1. 尚不支持本地化。
      2. 没有用于构建偏好面板的API,但可以开发为第三方并且与社区的其他成员共享

      3. 附加组件将包含具有抽象层次的代码,这将增加附加组件的大小(
        正在进行的工作将通过排除未被附件使用的文件来减小xpi大小)。


      I am developing (yet another) password manager add-on for Firefox. My add-on needs to:

      • Add two context menu items to each password field.
      • Open a dialog box or floating panel when the menu item is selected.
      • Access a specific method of a specific XPCOM component.
      • Fill the password field.
      • Include a preferences window.
      • Be compatible with Firefox 4.0.

      Preferably, also:

      • Run on Firefox 3.5 and 3.6.
        • Some users don't update to the latest version.
        • Firefox 4.0 won't run on a PowerPC Mac.
      • Install without a restart on Firefox 4.0.
      • Allow for localization.

      I have tried the Add-on SDK (formerly known as Jetpack), and it makes it very easy to start developing. However, I find that HTML cannot easily create "native looking" dialog boxes and that the SDK is rather heavyweight. (It takes many kilobytes to build a simple extension; that includes an XPCOM component!)

      What are the advantages and disadvantages of using the Add-on SDK to develop my Firefox extension? Is it ready for "serious" extension development?

      解决方案

      Advantages:

      1. Jetpack API exposes high level APIs for most of the things you mentioned:

        • Add two context menu items
        • floating panel
        • API for password manager
      2. Jetpack based add-ons are restart-less.

      3. Jetpack based add-ons are future proof in a sense that high level APIs will remain unchanged for the coming versions of FF.

      4. You may be able to use some community developed modules for APIs that are not exposed by SDK.

      5. If this is not the last extension you're planning to build there is a potential for code reuse, by building third party modules as ones mentioned in 4 (see docs for details)

      6. Support for mobile FF is coming in post 1.0 version of Addon-SDK which may mean that your extension can be made compatible with mobile version of FF with minimal to zero effort.

      7. Jetpack comes with build-in unit testing framework.

      8. Has a better security model, which will ease add-on review process.

      9. Jetpack support commonjs modules / packages that which means that some of the code can be borrowed from other projects like nodejs for example.

      Disadvantages:

      1. Jetpack no longer supports FF<4.
      2. Does not yet have support for localization.
      3. Has no API for building preference panels, but can be developed as third party module and shared with rest of the community.
      4. Add-on will contain code with layers of abstractions, that will increase size of add-on (there is ongoing work that will reduce xpi size by excluding files that are not used by add-on).

      这篇关于使用附加SDK来开发我的Firefox扩展有什么优点/缺点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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