Closed Bug 1120171 Opened 5 years ago Closed 7 months ago
Remove support for moz-prefixed XHR response
Types (moz-blob, moz-chunked-text, and moz-chunked-arraybuffer)
47 bytes, text/x-phabricator-request
|Details | Review|
Should probably warn first.
Posted the site compatibility doc: https://www.fxsitecompat.com/en-US/docs/2015/prefixed-xmlhttprequest-response-types-will-be-removed/
The PDF.js project is using moz-chunked-arraybuffer a lot. There is no Fetch and Stream API alternative API yet AFAIK. Shall we block this on bug 1147061 or bug (if exists) that will implement Streams API support for fetch()?
Summary: Remove support for moz-prefixed XHR responseTypes → Remove support for moz-prefixed XHR responseTypes (moz-blob, moz-chunked-text, and moz-chunked-arraybuffer)
https://developer.mozilla.org/nl/docs/Web/API/XMLHttpRequest does not (yet) indicate these are considered to be removed. I'm doing server-push (long polling), and sending multiple parts of binary data by doing FCGX_FFlush() on the server and then handling the data on the XMLHttpRequest onprogress event in the client. The remaining response types do not allow access to the received data, only indicate the number of bytes received. Is there a working alternative once the moz-prefixed types are removed?
MDN doesn't indicate that yet since we need first some telemetry data whether they can be removed (bug 1335365). Could you use WebSocket or EventSource? (last time I looked at, fetch() wasn't too good for this)
I would love a more portable solution, but have not found one yet. I looked into WebSockets, but then need to compile (and maintain) a patched version of lighttpd. EventSource is included in lighttpd but as far as I can see is not suitable for binary data. (For completeness, I'm using the moz-chunked-arraybuffer type, and an FCGI C-program on the server.)
I think for moz-chunked-arraybuffer usage fetch() is actually what you want, but we'd need to implement and ship bug 1128959 first. Doing that before removal seems reasonable to me.
Will fetch() work when my C back-end is connected to the lighttpd webserver using FCGI on Linux? If these things are not clear yet, I may as well wait for support for webSockets in lighttpd.
fetch() is basically the new XMLHttpRequest, an API for doing HTTP requests and responses with some extras. And since your setup works with the latter, it'll work with fetch().
Thank you, that is very interesting and also looks more portable. I'll see if I can use fetch() instead.
Updated the site compatibility note: https://www.fxsitecompat.com/en-CA/docs/2017/prefixed-xmlhttprequest-response-types-including-moz-blob-are-no-longer-supported/
A subtest of wpt/xhr/historical.html checks that moz-chunked-arraybuffer does not exist, and this fails, of course, only in Firefox.
Flags: needinfo?(ydelendik) → needinfo?(amarchesini)
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/3ff9e491c530 remove support for XMLHttpRequest moz-chunked-arraybuffer response type; r=baku
Assignee: nobody → twisniewski
You need to log in before you can comment on or make changes to this bug.