这是 Mac OS 上 Firefox 扩展的已知问题吗?
我开发了一个 firefox 扩展,其中包含由该 XUL 脚本定义的小对话框:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<prefwindow id="firenowPreferences" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="Fire.Now" ondialogaccept='onSave();' onload="checkFields();">
<script type="application/x-javascript">function onSave(){ alert('blablabla');}</script>
<prefpane id="pane1">
<grid>
<rows>
<row align="center"><label control="username">Username</label><textbox id="username"/></row>
<row align="center"><label control="password">Password</label><textbox type="password" id="password"/></row>
</rows>
</grid>
</prefpane>
</prefwindow>
可以尝试上面的代码 这里
问题是在Linux/Windows平台上(在firefox 3.5/3.6上)一切正常,我看到这样的东西:
http://img52.imageshack.us/img52/4210/shot1v.jpg
在 Mac OS 上,我可以看到同样的事情,但没有按钮!
如果您使用的是 Linux/Windows,请在此处尝试 XUL 脚本结果与屏幕截图相同,但如果您使用的是 Mac,则会有两个没有文本的小按钮(这很好,但在扩展程序中使用相同的 xul 代码,不会显示任何按钮)。
有什么建议吗?这是 Mac OS Firefox 的已知问题吗?
I've developed a firefox extension which contains a small dialog defined by this XUL script:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<prefwindow id="firenowPreferences" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="Fire.Now" ondialogaccept='onSave();' onload="checkFields();">
<script type="application/x-javascript">function onSave(){ alert('blablabla');}</script>
<prefpane id="pane1">
<grid>
<rows>
<row align="center"><label control="username">Username</label><textbox id="username"/></row>
<row align="center"><label control="password">Password</label><textbox type="password" id="password"/></row>
</rows>
</grid>
</prefpane>
</prefwindow>
The above code can be tried out here
The problem is that on Linux/Windows platform (on both firefox 3.5/3.6) everything works fine, and I see something like this:
http://img52.imageshack.us/img52/4210/shot1v.jpg
On Mac OS, instead, I can see the same thing but WITHOUT the button!
Trying out the XUL script here, if you are using Linux/Windows the result is the same as the screenshot, but if you are on Mac there are two small buttons without text (that would be fine, but using the same xul code within the extension, no buttons are shown).
Any suggestions? Is this a Mac OS firefox known issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在本机 Mac 应用程序中,首选项会立即生效,并且没有“确定”/“取消”按钮(例如,打开“系统首选项”)。 XUL
模仿这种行为。这种“即时应用”行为实际上是由首选项
browser.preferences.instantApply
控制的,如果您在 Windows 计算机上进行设置,您将看到“确定”/“取消”按钮消失。In native Mac applications preferences take effect instantly and there are no OK/Cancel buttons (open System Preferences for example). XUL
<prefwindow>
mimics this behavior.This "instant apply" behavior is actually controlled by a pref
browser.preferences.instantApply
, if you set that on a Windows machine, you'll see the OK/Cancel buttons go away.