This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27841 - Aborting request
Summary: Aborting request
Status: RESOLVED MOVED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: Fetch (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: Unsorted
Assignee: Anne
QA Contact: sideshowbarker+fetchspec
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-15 23:10 UTC by Arthur Stolyar
Modified: 2015-02-17 12:39 UTC (History)
1 user (show)

See Also:


Attachments

Description Arthur Stolyar 2015-01-15 23:10:29 UTC
Did not found any way to abort fetch request. Did I miss something there?
Comment 1 Anne 2015-01-16 09:28:08 UTC
See https://github.com/whatwg/fetch/issues/20 for some discussion on the matter.
Comment 2 Arthur Stolyar 2015-01-16 16:14:51 UTC
I have library there I made ajax abtraction which uses native Promise and returns them. Without ability to abort such requests it's a pain developing normal apps which uses ajax. So I decided to make some sort of subclassing of Promise, so ajax returns promise with additional method "abort". Of course, this cannot help in all situations such as Promise.all(...), but at least it works in situations such this:

var req = ajax(...).then(funnction() {return new Promise(...)});
...
req.abort(); // subclass of promise, actually native promise monkey-patched with |abort| method
...
Comment 3 Anne 2015-02-17 12:39:41 UTC
https://github.com/slightlyoff/ServiceWorker/issues/625 is now tracking this.