macos - 这是 Mac OS 上 Firefox 扩展的已知问题吗?

标签 macos firefox xul preferences

我开发了一个 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>

上面的代码可以尝试一下here

问题是在 Linux/Windows 平台上(在 Firefox 3.5/3.6 上)一切正常,我看到这样的东西:

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

相反,在 Mac OS 上,我可以看到相同的内容,但没有按钮!

尝试 XUL 脚本 here ,如果您使用的是 Linux/Windows,结果与屏幕截图相同,但如果您使用的是 Mac,则有两个没有文本的小按钮(这很好,但在扩展中使用相同的 xul 代码,不会显示任何按钮)。

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

最佳答案

在 native Mac 应用程序中,首选项会立即生效,并且没有“确定”/“取消”按钮(例如,打开“系统首选项”)。 XUL <prefwindow>模仿这种行为。

这种“即时应用”行为实际上是由首选项 browser.preferences.instantApply 控制的。 ,如果您在 Windows 计算机上进行设置,您将看到“确定/取消”按钮消失。

关于macos - 这是 Mac OS 上 Firefox 扩展的已知问题吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2243377/

相关文章:

android - Android Studio 2.0 QObject:无法从OSX上的另一个线程停止计时器

javascript - Firefox 字体失败

javascript - 从 Javascript 打开书签对话框

javascript - 如何使用 XUL、SDK 或 WebExtensions 技术从 Firefox 附加组件中的 JavaScript 动态修改 CSS 规则集(例如,使用类选择器)?

javascript - 打开或关闭 XUL 侧边栏 Firefox

ios - 如何防止 `pod install` 在不创建新目标的情况下将 libPods.a 添加到 "Link binary with Libraries"构建阶段?

java - 程序抛出 OutOfMemoryError : Java heap space when run in Mac but not in Ubuntu

c++ - 如何在 MacOS 上的 NodeJS native 插件上创建 OpenGL 上下文?

firefox-addon - Firefox 引导扩展 : Get native HWND handle of the browser window

css - 响应图像 srcset 忽略 div 宽度以在 Firefox 中显示比必要的更大的图像