【问题标题】:Add xul element to xul of Services.appShell.hiddenWindow将 xul 元素添加到 Services.appShell.hiddenWindow 的 xul
【发布时间】:2014-11-03 21:24:25
【问题描述】:

这是错误的:

Services.appShell.hiddenDOMWindow.document.createElementNS('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'browser');

这可能是因为Services.appShell.hiddenDOMWindow 是一个html 文档。如何添加到Services.appShell.hiddenWindow 它似乎没有.document


有趣的笔记:

Services.appShell.hiddenWindow != Services.appShell.hiddenDOMWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebNavigation).QueryInterface(Ci.nsIDocShellTreeItem).rootTreeItem.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow);

【问题讨论】:

    标签: javascript firefox firefox-addon xul


    【解决方案1】:

    我认为您不能创建<browser> 节点,您可以尝试使用iframe 代替吗?

    【讨论】:

    • 感谢 erik 的回复!这是一件奇怪的事情。 hiddenDOMWindow 是 html 文档,我认为 hiddenWindow 是 xul。但是 mac 本机菜单能够在 hiddenDOMWindow 中创建 xul 元素:gist.github.com/Noitidart/91ac5c5343ed791cea86#comment-1319720 我需要浏览器,因为我打算进行 docShell 交换 :(
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多