Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
734 views
in Technique[技术] by (71.8m points)

javascript - jpm run does NOT work with Firefox 48, or later

jpm version is 1.1.3
npm version is 2.15.8
Node version is 4.4.7
Firefox version is 48.0

Content of index.js:

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

Output of "jpm run" command

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. But, the desire output is not in the console.

Is there any problem with the code?

Content of my package.json file:

{  
  "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"   ]  
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

jpm run does not work with the release version of Firefox 48, or later

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. Thus, your add-on is being added to that Firefox profile, but is disabled:

jpm run

Disabled add-on with jpm run

You need to install and use a different version of 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. Assuming you don't want an old version of Firefox, your options are Firefox Developer Edition, Firefox Nightly, Unbranded Beta, or 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. These problems do not exist in the current Developer Edition (50.0a2) or 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). Thus, I recommend against using the Unbranded versions of Firefox at this time.]

The simplest thing to do is to download Firefox Nightly and start jpm using:

jpm run -b nightly 

Enabled add-on with jpm run -b nightly

The word nightly is a shortcut which resolves to the default location for Firefox Nightly to be installed. Depending on what OS you are using, there are other shortcut names which can be used (e.g. firefox, firefoxdeveloperedition, beta, nightly, and aurora). 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.

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.

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...