First of all, I’m well aware that Mozilla SDK extensions are going to be abandoned soon.
That being said, in the name of scientific endeavour I’d like to write an addon-sdk extension to customise parts of the browser UI. Specifically, the lower, locked section of the hamburger menu (the area which houses the “Quit” and “Help” buttons), the about:preferences page and about:addons.
Are there any APIs for it?
My own research only led me to XUL overlay addons (which, AFAIK, are unusable from JPM) and one bootstrapped addon called “Slipperymonkey” that promises adding a new list item to about:addons but doesn’t seem to work anymore.
However it’s not possible and it’s too early for UI customization questions. Android-native (JNI.jsm) support is in the same boat. No one has an answer to this question yet.
In my future proof version I have moved my GUI to a tab, as an HTML thing. Beta testers absolutely hate it. But there’s nothing we can do right now. Predicting what they’ll do and acting preemptively is a waste of time and effort, for example native.js and what it actually ended up as.
Disclaimer: This is just based on what I have heard/seen. I might be wrong.
let win = getMostRecentWindow(‘navigator:browser’);
Then you can access the panel GUI of that window. However the panelui loads lazily. So it wont all be there until you open the menu once.
After that you can access all the goods at win.PanelUI. You want to be looking at the footer section. I get that below at PUIf
This is an example of how to deal with it:
var getPUIMembers = function(aDOMWindow) {
// returns null if DNE or the object
var PUI = aDOMWindow.PanelUI;
if (!PUI) {
return {
PUI: null,
PUIp: null,
PUIf: null
}
}
var PUIp;
if (!PUI._initialized) {
PUIp = aDOMWindow.document.getElementById('PanelUI-popup'); // have to do it this way, doing PanelUI.panel does getElementById anyways so this is no pref loss
} else {
PUIp = PUI.panel; // PanelUI-popup
}
// console.log('PUI.mainView:', PUI.mainView, PUI.mainView.childNodes);
var PUIf = PUI.mainView ? PUI.mainView.childNodes[1] : null; // PanelUI-footer // aDOMWindow.PanelUI.mainView.childNodes == NodeList [ <vbox#PanelUI-contents-scroller>, <footer#PanelUI-footer> ]
return {
PUI: PUI,
PUIp: PUIp,
PUIf: PUIf
};