Skip to content

Instantly share code, notes, and snippets.

@luckyrat
Last active August 29, 2015 13:57
Show Gist options
  • Save luckyrat/9509676 to your computer and use it in GitHub Desktop.
Save luckyrat/9509676 to your computer and use it in GitHub Desktop.
Scratchpad code to reveal KeeFox 1.4 UI panel
let panelId = 'keefox-panelview';
let widgetId = 'keefox-button';
// Get the widget wrapper (toolbar button)
let wrapper;
wrapper = CustomizableUI.getWidget(widgetId);
// find the window it is attached to
var thewind = wrapper.instances[0].node.ownerGlobal;
// Find the view panel
let panelview;
try {
panelview = thewind.document.getElementById(panelId);
} catch (e) {
alert(e);
}
//TODO: show main menu panel if required
// Show our main viewpanel (might not work if its placed inside the main Firefox menu)
thewind.document.defaultView.PanelUI.showSubView(panelId,
wrapper.instances[0].anchor,
CustomizableUI.getPlacementOfWidget(widgetId).area);
// sometimes you might want to attach the panel somewhere more spatious...
//let b = thewind.document.getElementById('browser');
//b.insertBefore(panelview,b.firstChild);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment