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.
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.
You shouldn't be worried just because you see something that looks like a failure code (NS_BINDING_ABORTED
).
In one post a Firefox developer confirms that NS_BINDING_ABORTED
is simply an indication that a page load has been stopped.
It seems perfectly normal that opening a page while another page is being loaded cancels the loads on the first page. It doesn't necessarily mean the loads were aborted before the request got sent to the server, which seems to be what you care about.
[edit: reworded & removed the bit about me not being familiar with HttpFox, as people who see this in 2022 are probably not using it anyway.]
In my case, same NS_BINDING_ABORTED
error, but it was because a "button" element, which I clicked to trigger an event, was missing the attribute "type" value "submit" = How to prevent buttons from submitting forms
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.
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.
This is probably not the case of the OP here, but one of the reasons for seeing NS_BINDING_ABORTED
in Firefox is when the HTML of the page has responsive images.
These are <img>
tags with srcset
and sizes
attributes.
Take this HTML as an example:
<img srcset="
cheetah-400w.jpg 400w,
cheetah-500w.jpg 500w,
cheetah-600w.jpg 600w,
cheetah-800w.jpg 800w,
cheetah-1000w.jpg 1000w,
cheetah-1200w.jpg 1200w,
cheetah-1500w.jpg 1500w,
cheetah-1800w.jpg 1800w,
"
src="cheetah.jpg"
sizes="
(max-width: 768px) 100vw,
400px
"
alt="Cheetah"
/>
In Firefox it will download only one of the files in the srcset
attribute and show NS_BINDING_ABORTED
for all others.
You can read more about it the "Optimising images for High DPI displays" article on pixboost.com/, which is also the source of the above code.
The error NS_BINDING_ABORTED
can have a variety of reasons.
In my case it was garbage in the response headers received from the server, basically a HTTP protocol violation.
Using a web debugging proxy such as Fiddler may sometimes reveal such issues better than the browser's own debugging console (which today does what, I assume, HttpFox did, just better), or at least show more detailed information or clearer error messages.
Dev Tools
. Make sure to also enable Persistent Logs
, in the settings cogwheel, so you don't miss event when a page refreshes or reloads something. The thing to look out for are 401
authentication issues. –
Malignity 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);
};
I know this is a very old question but this happened to me recently with Firefox 95. The images of an ancient application made by a collegue of mine were not loaded (or loaded randomly) because of this code:
window.addEventListener('focus', function() {
// omit other code...
location.reload();
}
Once nested this code into a 'load' listener, the issue completely disappeared.
in my case experience, NS_BINDING_ABORTED occurred because missing closed tag between <form>...</form>
example:
<form name="myform" action="submit.php" method="post">
<div class="myclassinput">
<input type="text" name="firstname">
<input type="text" name="lastname">
<input type="submit" value="Submit">
</form>
there is I am forget to write closing </div>
tag before </form>
.
I note my experience here, just in case... For me it was a website on a local dev server (adress 192.... etc) which was put online on an already used URL like www.something.com The consequence was that an MP4 video (through the H5P library) didn't play, but allowed to be scrolled through the progress bar. And when I copy/paste the URL to this video, this NS_BINDING_ABORTED error appeared on my laptop, while my colleague on the same internet connection had no problem to view it.
I made an ipconfig /release and /renew, then restarted my computer, and it was fixed... maybe it was some old data conflict with the previous content on this already used URL domain? I don't know.
For me reason was in Firefox browser preventDefault function not worked in form submit event. This answer helped to solve: https://mcmap.net/q/168633/-how-can-i-prevent-form-submission-page-navigation-on-artificial-submit-event-in-firefox
In my case I had a page that would just redirect to a native application and the redirect was triggered before the "onPageLoad" event. That redirect was forcing Firefox to abort the page from loading, so no images would be loaded.
Waiting for the page to load resolved the problem.
Same behavior was not seen on Chrome or Edge.
In my case this happened when I tried to do ajax
request when page still loading. My code was:
<script type="text/javascript" src="/script.js"></script>
<div id="example-form"></div>
<script type="text/javascript">
var schema = $.ajax( ... );
</script>
I just wrapped my code into onload
:
<script type="text/javascript" src="/script.js"></script>
<div id="example-form"></div>
<script type="text/javascript">
$(window).on('load', function() {
var schema = $.ajax( ... );
});
</script>
So, as I can see, I should not do ajax
requests, when main page was not loaded yet.
The reason this problem occurred to me is that I tried to trigger a JavaScript function that posts something to the BE using a button that was in a form.
The form has its own logic and the submit button.
However i did not know that if you add a button to a form it will automatically add it type submit. And my problem occurred by sending two requests at the same time to the server. The server couldn't handle both.
This was done in Django.
My fix was to replace the button tag with the tag and add some jQuery that calls my function on a click.
I resolved this issue by clearing cache before my ajax call using simple javascript if you are using any another language clear cache using other language's code.
if (window.location.href.indexOf('?') < 0) {
window.location.href = window.location.href + '?';
}
In my case NS_BINDING_ABORTED, "Unknown Error", error: abort", was caused by aborting API GET call. I have Angular SSR and implemented TransferHttpCacheModule this prevents Firefox to call duplicate GET (on server side and again on Browser side). Behavior is correct, other browsers do not log this error.
To prove this I just commented TransferHttpCacheModule in imports in the app.module.ts. error disappeared, but of course you want to use TransferHttpCacheModule.
Message NS_BINDING_ABORTED is equivalent to "Cancelled" in Chrome DevTools. From the user's perspective, this basically means a program decided to abort/cancel the current process due to lack of speed, for example, when a video player encounters a video chunk that can't be downloaded in time.
You can trigger it:
- XMLHttpRequest.abort() https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/abort
- Fetch and AbortController https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort
Goog luck C0ders!
© 2022 - 2024 — McMap. All rights reserved.