简体   繁体   English

jpm run不适用于Firefox 48或更高版本

[英]jpm run does NOT work with Firefox 48, or later

jpm version is 1.1.3 jpm版本是1.1.3
npm version is 2.15.8 npm版本是2.15.8
Node version is 4.4.7 节点版本是4.4.7
Firefox version is 48.0 Firefox版本是48.0

Content of index.js : index.js的内容:

var self = require("sdk/self");  
console.log("************************************");

Output of "jpm run" command 输出“jpm run”命令

JPM [info] Starting jpm run on My Jetpack Addon  
JPM [info] Creating a new profile

As per the content of the index.js file, a line of * symbols should be output on the console. 根据index.js文件的内容,应在控制台上输出一行*符号。 But, the desire output is not in the console. 但是,欲望输出不在控制台中。

Is there any problem with the code? 代码有问题吗?

Content of my package.json file: 我的package.json文件的内容:

{  
  "title": "My Jetpack Addon",  
  "name": "temp",   
  "version":  "0.0.1",  
  "description": "A basic add-on",
  "main": "index.js",    
  "author": "",   
  "engines": {  
      "firefox": ">=38.0a1",  
       "fennec": ">=38.0a1"   },   
   "license": "MIT",  
   "keywords": [  
      "jetpack"   ]  
}

jpm run does not work with the release version of Firefox 48, or later jpm run不适用于Firefox 48或更高版本的发行版

The issue is not jpm , but that you are attempting to use it with the release version of Firefox 48. As of Firefox 48, Mozilla has disabled the ability of the setting the preference xpinstall.signatures.required to false to permit unsigned add-ons to be loaded. 问题不是jpm ,而是你试图在Firefox 48的发布版本中使用它。从Firefox 48开始,Mozilla已禁用将首选项xpinstall.signatures.required设置为false以允许未签名的附加组件的功能要加载。 Thus, your add-on is being added to that Firefox profile, but is disabled: 因此,您的加载项将添加到该Firefox配置文件中,但已被禁用:

jpm run

使用jpm run禁用加载项

You need to install and use a different version of Firefox 您需要安装和使用不同版本的Firefox

To test your add-on, you will need to install a different version of Firefox and use the -b option to jpm run to tell jpm which version of Firefox to use . 要测试你的插件,你需要安装不同版本的Firefox并使用-b选项来jpm run以告诉jpm哪个版本的Firefox Assuming you don't want an old version of Firefox, your options are Firefox Developer Edition , Firefox Nightly , Unbranded Beta, or Unbranded Release . 假设您不想使用旧版本的Firefox,您可以选择Firefox Developer EditionFirefox NightlyUnbranded Beta或Unbranded Release

[Note (2016-08-11): My testing over the last couple of days has shown that the Unbranded Release version of Firefox 48, and the Unbranded Beta version of Firefox 49.0b2 exhibit problems which were not in 48 or 49 while those versions were Nightly or Developer Edition. [注意(2016-08-11):我在过去几天的测试表明,Firefox 48的Unbranded Release版本和Firefox 49.0b2的Unbranded Beta版本存在的问题不是48或49而是那些版本是Nightly或Developer Edition。 These problems do not exist in the current Developer Edition (50.0a2) or Nightly (51.0a2). 当前的Developer Edition(50.0a2)或Nightly(51.0a2)中不存在这些问题。 In other words, I have an add-on which works in Developer Edition (50.0a2), & Nightly (51.0a2), and worked in both Developer Edition (49.0a2), and Developer Edition (48.0a2), but which does not work in Unbranded Release (48.0), or Unbranded Beta (49.0b2). 换句话说,我有一个加载项,可以在Developer Edition(50.0a2)和Nightly(51.0a2)中使用,并且可以在Developer Edition(49.0a2)和Developer Edition(48.0a2)中工作,但是它没有在Unbranded Release(48.0)或Unbranded Beta(49.0b2)中工作。 Thus, I recommend against using the Unbranded versions of Firefox at this time .] 因此, 我建议不要在此时使用非品牌版本的Firefox 。]

The simplest thing to do is to download Firefox Nightly and start jpm using: 最简单的方法是下载Firefox Nightly并使用以下命令启动jpm

jpm run -b nightly 

每晚使用jpm run -b启用加载项

The word nightly is a shortcut which resolves to the default location for Firefox Nightly to be installed. nightly这个词是一个快捷方式,它解析为Firefox Nightly的默认位置。 Depending on what OS you are using, there are other shortcut names which can be used (eg firefox , firefoxdeveloperedition , beta , nightly , and aurora ). 根据您使用的操作系统,还可以使用其他快捷方式名称(例如firefoxfirefoxdevelopereditionbetanightlyaurora )。 However, they do not resolve correctly on all operating systems. 但是,它们无法在所有操作系统上正确解析。 You always have the option of specifying the complete path to the Firefox version you desire to use. 您始终可以选择指定要使用的Firefox版本的完整路径。

The other alternative to using the -b option to specifying the path is to change the JPM_FIREFOX_BINARY environment variable to the path to the Firefox executable which you wish to use with jpm . 使用-b选项指定路径的另一种方法是将JPM_FIREFOX_BINARY环境变量更改为您希望与jpm一起使用的Firefox可执行文件的路径。

Note: I have updated the installation documentation for jpm on MDN to reflect the need to have a non-release version for Firefox as of Firefox 48. If you have recently visited that page, you may need to use Ctrl - F5 to refresh the page in order to see the new content. 注意:我已经在MDN上更新了jpm的安装文档 ,以反映从Firefox 48开始为Firefox提供非发行版本的需要。如果您最近访问过该页面,则可能需要使用Ctrl - F5刷新页面为了看到新内容。

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

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