Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Avoid panel to autoHide in Firefox extension

I am actually trying to develop a Firefox extension using the high level apis, and specifically trying to avoid a panel to autohide when you pick a file or when you click outside of the panel itself.

Does somebody has an idea of how to do this?

I know that it is possible using XUL, so why is this not easy using the apis?

Thank you in advance for your answers.

like image 465
Manny42 Avatar asked Feb 02 '14 10:02

Manny42


2 Answers

This is the offical sdk method of doing it:

let myPanel = Panel({.....})

let { getActiveView }=require("sdk/view/core");
getActiveView(myPanel).setAttribute("noautohide", true);
like image 186
Noitidart Avatar answered Oct 21 '22 07:10

Noitidart


Idea from this

var toolbarbuttonPanel = doc.createElement('panel');
toolbarbuttonPanel.setAttribute('id', 'toolbarbutton-panel');
toolbarbuttonPanel.setAttribute('type', 'arrow');
toolbarbuttonPanel.setAttribute('noautohide', 'true'); // This is important

var toolbarbuttonLabel = doc.createElement('label');
toolbarbuttonLabel.setAttribute('value', 'toolbarbutton panel');
toolbarbuttonPanel.appendChild(toolbarbuttonLabel);

var mainPopupSet = document.querySelector('#mainPopupSet');
mainPopupSet.appendChild(toolbarbuttonPanel);

Then add this on sdk action/toggle button click:

toolbarbuttonPanel.openPopup(btn);

And Noitidart's comment

like image 1
jmjm Avatar answered Oct 21 '22 08:10

jmjm