【问题标题】:Open XUL application without navigation bar打开没有导航栏的 XUL 应用程序
【发布时间】:2013-07-08 14:41:25
【问题描述】:

我创建了一个 XUL 对话框,每当我打开此对话框时,它都会使用 Firefox 导航栏打开。是否可以在没有 Firefox 导航栏的情况下打开 XUL 应用程序?附上截图。我正在使用 Javascript 的 window.open 命令。即

window.open("http://localhost/test.xul", "test", "chrome, width=130,height=60, menubar=no");

这是 XUL 代码

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<dialog id="donothing" title="Dialog example"
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  buttons="accept,cancel"
  buttonlabelcancel="Cancel"
  buttonlabelaccept="Save"
  ondialogaccept="return doOK();"
  ondialogcancel="return doCancel();">

  <dialogheader title="Options" description="My preferences"/>
  <groupbox>
    <caption label="Colour"/>
    <radiogroup>
      <radio label="Red"/>
      <radio label="Green" selected="true"/>
      <radio label="Blue"/>
    </radiogroup>
    <label value="Nickname"/>
    <textbox/>
  </groupbox>
</dialog>

【问题讨论】:

    标签: firefox firefox-addon xul


    【解决方案1】:

    尝试在 window.open 中添加“location=no”:

    window.open("http://localhost/test.xul", "test", "chrome, width=130,height=60, menubar=no, location=no");
    

    参考window.open

    【讨论】:

    • 感谢您的信息,但它在最新的 firefox 中不起作用,因为 firefox 已禁用它,但我们可以从 about:config 启用它。
    • @TPSstar - 我不知道这是否是你真正想要的,但你可以使用:window.openDialog("http://localhost/test.xul","", "all=no",""); 参见参考window.openDialog
    • 我试过了,但是 javascript 给出了错误“SeurityError: The operation is insecure.”。
    • @TPSstar - 嗯。诡异的。我自己做了,没有错误:window.openDialog("chrome://testExt/content/test.xul","", "all=no",""); 你是从 chrome:// 加载 xul 文件吗?
    猜你喜欢
    • 1970-01-01
    • 2021-05-03
    • 1970-01-01
    • 1970-01-01
    • 2018-03-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-09
    相关资源
    最近更新 更多