Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XHR.timeout is not implemented #431

Closed
kumar303 opened this issue Mar 11, 2014 · 7 comments
Closed

XHR.timeout is not implemented #431

kumar303 opened this issue Mar 11, 2014 · 7 comments

Comments

@kumar303
Copy link

In this example,

var xhr = new XMLHttpRequest();
xhr.timeout = 1;
xhr.open(...);
xhr.send(...);

the timeout property does not seem to be implemented by Sinon's fake XHR. https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#Properties

I was expecting it to trigger the timeout event. It would be nice if this were implemented or at least documented as such.

I'm using Sinon from node @1.9.0

@cjohansen
Copy link
Contributor

This is not implemented - yet. I assume this is from the xhr2 spec? Do you know the browser support situation, and if it can be feature detected?

@kumar303
Copy link
Author

Oh, I didn't know it was a new feature. It seems to be everywhere except for Safari: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#Browser_Compatibility

@kumar303
Copy link
Author

I think you could detect it just by:

var xhr = new XMLHttpRequest();
if (typeof xhr.timeout !== 'undefined') {
...
}

@mroderick mroderick added the XHR label Aug 12, 2014
@tarmolov
Copy link

Safari 7.0.6 supports xhr.timeout.

@marian-r
Copy link

marian-r commented Aug 7, 2015

No updates on this?

@cjohansen
Copy link
Contributor

PR welcome!

@mroderick
Copy link
Member

It's been more than 500 days since last activity on this. I am closing it. If anyone wants to create a PR that would be great

This was referenced Jul 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants