Is this a known issue in firefox extensions on Mac OS?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 11:12:37

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/2243377/is-this-a-known-issue-in-firefox-extensions-on-mac-os

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