-
Notifications
You must be signed in to change notification settings - Fork 311
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
notification of cancelled download? #957
Comments
Maybe with ReadableStream? You could interpose a js monitor and observe if the stream is closed before its fully read. The browser may read ahead and buffer though. |
I'm passing a ReadableStream into the Response's constructor. The stream's underlyingSource has a 'cancel' method, but that is never called. Also, i can call controller.enqueue without error after the download is cancelled. |
That just sounds like a bug in Chrome to me... /cc @yutakahirano |
Thank you for reporting, I filed a bug. |
Thanks. I think it's fantastic that Chromium even handles this at all (I didn't see anything about attachments in the SW spec, though). IMHO being able to completely customize how the browser does downloads is a game-changer for us: we're using it to concurrently stream chunks of multiple huge, CDN-hosted files directly into a client-side archive. |
Eventually we'll also have a cancel token on the fetch event to signal a cancellation of the request. |
why was this closed? is this fixed? |
did anything happen with this, or did it just get swept under the rug? |
Nothing's been swept under the rug. Read the comments above. This tracker is for spec issues, but what you identified was a Chrome bug. A ticket to the Chrome bug was posted above, and this issue was closed because there's no change to the spec needed. |
If a ServiceWorker's 'fetch' event responds with a Response with a
'Content-Disposition': 'attachment; filename=blah'
header, the browser starts a download.Is there any way for the ServiceWorker to know if/when the user cancels the download (in the
chrome://downloads/
window)?I would have expected the
cancel(reason)
method of theResponse
stream's underlyingSource to be called. But in Chrome v52.0.2743.116, it's not.The text was updated successfully, but these errors were encountered: