Last active
August 29, 2015 13:57
-
-
Save luckyrat/9509676 to your computer and use it in GitHub Desktop.
Scratchpad code to reveal KeeFox 1.4 UI panel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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