NS_BINDING_ABORTED Shown in Firefox with HttpFox

人走茶凉 提交于 2020-12-29 08:59:55

问题


I am seeing some of the server calls (Used for tracking purpose) in my site getting aborted in Firefox while seeing through HttpFox. This is happening while clicking some link that loads another page in the same window. It works fine with popup. The error type shown is NS_BINDING_ABORTED. I need to know is the tracking call is hitting the server or not. It works perfectly with Internet Explorer. Is it any problem with the tool? In that case can you suggest any that can be used in Firefox too.


回答1:


Because your server is not sending HTTP Expires headers, the browser is checking to see if what is in its cache is current.

The way it does this is to send the server a request saying what the date of what it has in the cache is, and the server is sending 304 status telling the client that what it has is current. In other words, the server is not sending the entire content again but instead sending just a short header to say the existing cache content is current.

What you probably need to fix, is to add Expires headers to what you are serving. Then you will see the NS_BINDING_ABORTED message change to (cache), meaning the browser is simply getting content out of its cache, knowing it has not yet expired.

I should add that, when you do a FireFox forced refresh, it assumes that you want to double-check what is in the cache, so it temporarily ignores Expires.




回答2:


So the problem is that the tool you use (HttpFox) reports to you some failure code (NS_BINDING_ABORTED) which you don't understand?

http://markmail.org/message/m6z77uoixf3qu7u6 might be helpful.

Also from your short description and without actually knowing what HttpFox is, it sounds perfectly normal that opening a page while another page is being loaded cancels the loads on the first page. It doesn't mean the loads were aborted before the request got sent to the server, which seems to be what you care about.




回答3:


What other javascript do you have on the page? Some javascript might be firing causing the request to be aborted.

I noticed the same thing in my application. I was redirecting the page in javascript (window.location = '/some/page.html') but then further down the block of code, I was calling 'window.reload()'. The previous redirection was aborted because window.reload was called.

I don't know what tracking you are using but it's possible that the request is being sent to your server but the request is aborted because another request was issued afterwards.




回答4:


NS_BINDING_ABORTED error - Best Approach -Using a JavaScript “setInterval” method with the time delay of Min ‘0’ to max ‘100’ milliseconds based on the page load, we can execute our track link request after the default page submit request is processed.

World best solution:

var el = document.getElementById("t");
el.addEventListener("click", avoidNSError, false); //Firefox

function avoidNSError(){
  ElementInterval = setInterval(function () {
 /* Tracking or other request code goes here */
  clearInterval(ElementInterval);
 },0);

};



回答5:


I have experienced a similar problem, but have identified the cause.

I have a link in the first cell of a table row, and some Javascript that replicates that link across the other TD's of the row. When I click on the 'real' link (in the first cell) I get this unwanted side-effect; when I click on other cells in the row, all is fine. I feel it's because the script is adding a second link to that first cell, when it already has one.

Hence, two instantaneous requests for the same page, with the first being aborted by the second.

This technique is fairly common, so something to look out for.




回答6:


I got a similar issue when some resources (fonts) were missing, that a page was trying to call. If you're only getting an issue in Firefox, is Firefox trying to retrieve a slightly different resource than IE?



来源:https://stackoverflow.com/questions/704561/ns-binding-aborted-shown-in-firefox-with-httpfox

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!