1

我有一个需要在请求中发送特殊标头的 Web 服务。我能够使用 XMLHttpRequest 和 setRequestHeader() 检索预期的 responseXML。

现在我想创建一个包含响应文档的新选项卡(或窗口)。我希望将默认 XMLPrettyPrint.xsl 文件应用到它,并且在查看源代码时,我希望在查看普通 .xml 文件时看到未设置样式的源代码。

有任何想法吗?

4

1 回答 1

1

我最终创建了一个协议处理程序。

我发现没有很好记录的最大技巧是 XPCOM 合同 ID 必须以“@mozilla.org/network/protocol;1?name=”开头。例如,:

/* as in foo:// . This is called the scheme. */
var thisIsWhatMyProtocolStartsWith = "foo"; 
var contractID = "@mozilla.org/network/protocol;1?name=" + thisIsWhatMyProtocolStartsWith;
于 2009-04-30T21:27:46.407 回答