Firefox addon doesn't work when using % in menu label and tooltip

别来无恙 提交于 2019-12-24 08:47:07

问题


I am working on a firefox addon, and when I use % for a menu label and tooltip the addon doesn't work (doesn't show up on firefox).

I am using the % in a .dtd file like this:

<!ENTITY addonName.menuX "%09 (Tab)">

And in the .xul file like this:

<menuitem class="menuitem-iconic" image="chrome://addonName/skin/image.png" tooltiptext="&addonName.menuX;" label="&addonName.menuX;" oncommand="addonName.function( 'X' )" />

If I delete the % from <!ENTITY addonName.menuX "%09 (Tab)"> it works fine. I tried escaping it with a backslash but still doesn't work, so how do I print % in the addon menu?


回答1:


unicode equivalent of % which is \u0025 should work.



来源:https://stackoverflow.com/questions/3496078/firefox-addon-doesnt-work-when-using-in-menu-label-and-tooltip

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!