Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/417.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 将xul元素添加到Services.appShell.hiddenWindow的xul_Javascript_Firefox_Firefox Addon_Xul - Fatal编程技术网

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交换: