A
A
Alexander Melnichenko2015-05-20 16:43:15
Mozilla Firefox
Alexander Melnichenko, 2015-05-20 16:43:15

How to set cookies in firefox addon sdk/panel?

I'm writing an extension for Firefox using the add-on sdk.
I create a panel attached to a button on the control panel.
From the panel, requests are made to the server, but the problem is that cookies are not set, therefore it is impossible to retain authorization.
If the requests come from the backgroud, then everything is ok there.
Help solve the issue. I do not want to let questions through the background.
var popup_panel = require("sdk/panel").Panel({
contentURL : data.url("popup.html"), //panel content
contentScriptFile : [ //included scripts
data.url("js/functions.js" ),
data.url("js/jquery.js"),
],
width : 300, //panel width
height : 600, //panel height
onHide : function () {
button.state('window', {checked: false});
}
});
var button = require('sdk/ui/button/toggle').ToggleButton({
id : "button",
label : 'button_label',
icon : data.url("icons/icon16.png"),
onChange : function ( state) {
if (state.checked) {
popup_panel.show({
position: this,
contentURL : data.url("popup.html")
});
}
}
});

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question