I am trying to set popupshowing handler when the popup opens so I can set the margin-right of the “.panel-arrow” dynamically I tried to use XUL Bindings and when the popup shows I will set the margin-right of the “.panel-arrow” dynamically.
<?xml version="1.0"?>
<bindings xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<binding id="panelext_panel_arrow_binding" extends="chrome://global/content/bindings/popup.xml#arrowpanel">
<resources>
<stylesheet src="chrome://panelext/skin/panel.css"/>
</resources>
<handlers>
<handler event="popupshowing">
<![CDATA[
var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
.getService(Components.interfaces.nsIConsoleService);
consoleService.logStringMessage("panelext CHECK");
]]>
</handler>
</handlers>
</binding>
</bindings>
The resource binding is workings but the handlers isn`t.
I just complicated it – the fix is just to add onpopupshowing=”EXTENSION_NAME.popupshowing()” to the panel.