I currently am making a Firefox extension with Firefox add on sdk and I tried to communicate between content script (page mod) and popup (panel) to no avail.
I am using toolbar button by Erik Vold. Here is my code:
var tbb = require('toolbarbutton').ToolbarButton({
id: 'from-us_button',
label: 'from-us',
image: data.url('img/on.png'),
panel: panel
});
var pageMod = require('page-mod').PageMod({
include: "*",
contentScriptFile: [
data.url('recuperation.js')
],
contentScriptWhen : "end",
attachTo: ["existing", "top"]
});
var panel = require('panel').Panel({
width: 200,
height: 500,
contentURL: data.url('popup.html')
});
My popup.html contains:
<script type="text/javascript" src="popup.js"></script>
I would like to pass a variable from recuperation.js to popup.js, how could I do that?