如何在本地测试Firefox插件 [英] How to test firefox plugin locally

查看:206
本文介绍了如何在本地测试Firefox插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基本的谷歌浏览器扩展需要被移植到Firefox。我上传了.crx文件到Firefox市场,它已经被接受,但现在正在审查中。我下载了生成的xpi文件,并试图在本地安装,但没有任何成功。它告诉该插件无效或损坏。

另一个我试过的方法是使用或 Firefox每晚。您还应该仔细注意您需要使用哪种Firefox版本。这些信息包含在MDN文档页面的浏览器兼容性部分中。
$ b

Firefox附加SDK



<要测试基于Firefox附加SDK的附加组件,请使用 jpm run 。你可能想看一下这个回答jpm run不适用于Firefox 48或更高版本。 p>

I have a basic Google Chrome extension which needs to be ported to Firefox. I uploaded the .crx file to the Firefox marketplace and it got accepted but is under review rightnow. I downloaded the the generated xpi file and tried to install it locally but without any success. It tell that the plugin is invalid or corrupted.

Another method that I tried is I ported the extension using chrome-tailor and generated the xpi. I am able to install the extension in this but the content scripts are not injected and the extension doesn't work as expected.

I want to install it in Firefox and test it. I have also set xpinstall.signatures.required to false.

解决方案

WebExtensions

To test WebExtension based add-ons, they are usually loaded as a "Temporary Installation in Firefox"

That MDN page describes how to temporarily install a WebExtensions (i.e. similar code to Chrome) in Firefox. The gist of it is:

  1. Navigate to about:debugging
  2. Click the button "Load Temporary Add-on"
  3. Use the file selection dialog to select the manifest.json file, or packaged .xpi file for the extension.

Note on testing WebExtensions:
The WebExtensions API is still in development. For now, you are probably best off developing and testing your WebExtension add-on with Firefox Developer Edition, or Firefox Nightly. You should also make careful note of what version of Firefox is required for the functionality you desire to use. This information is contained in the "Browser compatibility" section of the MDN documentation pages.

Firefox Add-on SDK

To test Firefox Add-on SDK based ad-ons, use jpm run. You might want to take a look at this answer to "jpm run does NOT work with Firefox 48, or later"

这篇关于如何在本地测试Firefox插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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