Javascript 将xul元素添加到Services.appShell.hiddenWindow的xul
这是一个错误:Javascript 将xul元素添加到Services.appShell.hiddenWindow的xul,javascript,firefox,firefox-addon,xul,Javascript,Firefox,Firefox Addon,Xul,这是一个错误: 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.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);
我认为你不能创建节点,你能试试iframe吗?谢谢erik的回复!这是件奇怪的事。hiddenDOMWindow是html文档,我认为hiddenWindow是xul。但是mac native menu能够在hiddenDOMWindow中创建xul元素:我需要浏览器,因为我打算进行docShell交换: