这是在Mac OS上的Firefox扩展中的已知问题? [英] Is this a known issue in firefox extensions on Mac OS?

查看:200
本文介绍了这是在Mac OS上的Firefox扩展中的已知问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个firefox扩展,它包含一个由这个XUL脚本定义的小对话框:

 <?xml version =1.0encoding =UTF-8?> 
<?xml-stylesheet href =chrome:// global / skin /type =text / css?>
< prefwindow id =firenowPreferencesxmlns =http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xultitle =Fire.Nowondialogaccept ='onSave() ;'onload =checkFields();>
< script type =application / x-javascript>函数onSave(){alert('blablabla');}< / script>
< prefpane id =pane1>
< grid>
< rows>
< row align =center>< label control =username>用户名< / label>< textbox id =username/>< / row>
< row align =center>< label control =password> Password< / label>< textbox type =passwordid =password/>< / row>
< / rows>
< / grid>
< / prefpane>
< / prefwindow>

上面的代码可以试用 here



问题是在Linux / Windows平台上firefox 3.5 / 3.6)一切工作正常,我看到这样的事情:



http://img52.imageshack.us/img52/4210/shot1v.jpg

在Mac OS ,相反,我可以看到同样的事情,但没有按钮!



试用XUL脚本这里,如果你使用的是Linux / Windows,结果和屏幕截图是一样的,但是如果你在Mac上有两个没有文字的小按钮(这样可以,但是使用相同的xul代码没有按钮显示)。



有什么建议吗?这是一个Mac OS的Firefox的已知问题?

解决方案

在原生Mac应用程序首选项立即生效,并没有确定/取消按钮(例如打开系统偏好设置)。 XUL < prefwindow> 模仿这种行为。

这个即时应用行为实际上由一个pref browser.preferences.instantApply ,如果你在Windows机器上设置,你会看到确定/取消按钮消失。


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?

解决方案

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.

这篇关于这是在Mac OS上的Firefox扩展中的已知问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆