我正在编写一个使用大量 XMLHttpRequest 的 Firefox 扩展,遵循 the sample code at MDC 的模式.大多数情况下,这工作得很好,但有些请求会导致以下消息出现在控制台中:
Http channel implementation doesn't support nsIUploadChannel2. An extension has supplied a non-functionalhttp protocol handler. This will break behavior and in future releases not work at all.
据我所知,我的扩展没有提供任何新的 http 协议(protocol)处理程序;它只是使用 Firefox 内置的功能。这不是另一个扩展,因为我尝试禁用所有其他扩展,并得到相同的结果。我也没有看到任何特定模式来解释为什么我收到此消息的某些请求而不是其他请求。
这条消息是什么意思,如果有的话,我做错了什么?
编辑: 这似乎经常发生在我发送两个 XmlHttpRequest 时,一个紧接着另一个。我提出这个是因为我刚好遇到 this page about how the browser will only send two requests at once, and will queue up any others internally .所以这可能与此有关,但我不知道。
最佳答案
作为答案重新发布:
原来发生这种情况是因为我试图使用 XMLHttpRequest 获取页面源到 View 源:URL ( bugzilla bug )。
正如 Bugzilla 上有人友善地指出的那样,这有点毫无意义。我现在正在使用 this technique这实际上是按照我的意图进行的——从缓存中获取源代码而不发出新的 HTTP 请求。
关于javascript - "Http channel implementation doesn' t 支持 nsIUploadChannel2。一个扩展提供了一个非功能性的 http 协议(protocol)处理程序”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3587820/