Extension works fine with jpm run. But not with jpm xpi

I have created a small addon extension:
it adds a small button and when button is clicked, it opens a popup window.

This works fine with jpm run

When I run jpm xpi the xpi file is created.
I install it manually : button appears on my firefox. But when I click it, nothing happens:
Any idea on how to solve that ?

I tried to debug it, but I don’t see any console.log messages any more.

Got a link to the XPI for us to play with?

This works with jpm run, but does not work with jpm xpi

main.js

var background = require("sdk/page-worker").Page({
	contentScriptFile: ['./jquery.min.js', './background.js'],  	
});

background.js

self.port.on('popup', function(url){
	console.log('popup');
	var win = window.open(url, "new","width=640, height=480");
})

on jpm run, popup opens ! on jpm xpi (and xpi installed), popup does not open any more !

It doesn’t work at all for me when I test it.

My ultime goal is infact:
open a popup window with an external script. Then this popup should send back some info to main.js

I tried with:

  url='http://www.mysite.com/myPopup.html';
  win = require('sdk/window/utils').openDialog({
	url:url,
        features: Object.keys({
          resizable: true,
          scrollbars: true
    }).join(),
    name: "win",
    load: windowLoaded()
});

This works: it opens the popup. But I cannot attach any content script. I don’t know how myPopup.html can send some info to main.js

Any clue is welcome. I can pay you a beer if you can help me with that !

Whoa, need to stop you there. An external script will not be accepted through AMO.

I have done that chrome extension already: I am trying to adapt it to firefox.
Let me explain : the extension is a simple button that popups a site chat.

On this site chat I store in localStorage the username of the user when loggedon: I just need to get that localStorage[“username”] to main.js

I guess there are many ways to do it: but I haven’t found any that works !

Regards