xdomain
xdomain copied to clipboard
Bug: Properly serialize and deserialize "Blob" and "File" on Firefox
Hi,
It looks like xdomain handles the contents of FormData properly, but I'm working with an API where we pass raw data around sometimes -- Blob
and File
types. This works fine with Chrome and IE10 but fails on Firefox (DataCloneError) with their longstanding Blob postMessage nonsense. https://bugzilla.mozilla.org/show_bug.cgi?id=722126
I'm looking at the stuff that serializes and deserializes FormData on the masters and slaves -- I think adding support for Blob and File wouldn't be too difficult -- it's the same method, just without the FormData wrapper. Probably I'll submit a PR this weekend if I'm on the right track here.
Thanks!
It should already be converting files and blobs to a uint8array, let me read through the code though, haven't looked at it for quite a while
On Saturday, October 11, 2014, Eli Mallon [email protected] wrote:
Hi,
It looks like xdomain handles the contents of FormData properly, but I'm working with an API where we pass raw data around sometimes -- Blob and File types. This works fine with Chrome and IE10 but fails on Firefox (DataCloneError) with their longstanding Blob postMessage nonsense. https://bugzilla.mozilla.org/show_bug.cgi?id=722126
I'm looking at the stuff that serializes and deserializes FormData on the masters and slaves -- I think adding support for Blob and File wouldn't be too difficult -- it's the same method, just without the FormData wrapper. Probably I'll submit a PR this weekend if I'm on the right track here.
Thanks!
— Reply to this email directly or view it on GitHub https://github.com/jpillora/xdomain/issues/119.
ahh I see, you'd like to xhr.send(file || blob)
sorry, didnt see the second paragraph, PR away :)
Getting the following in IE9:
SCRIPT5034: Circular reference in value argument not supported
File: xdomain.js, Line: 842, Column: 7
@sgarbesi http://caniuse.com/formdata it's not supported by IE[89]
HI, Before including Xdomain.min.js in the project while fetching the stream(MemoryStream) response from WEB API using ActionResult and then converted that blob data using below code snippet into pdf file format.
var blob = new Blob([res._body], { type: 'application/pdf' }); this.fileUrl = this.sanitizer.bypassSecurityTrustResourceUrl(window.URL.createObjectURL(blob)); if (callingFrom === 'download') { let element = this.downloadLink.nativeElement; element.href = this.fileUrl.changingThisBreaksApplicationSecurity; element.click(); } Once I include Xdomain plugin in the project to fix CORS issue stream response is getting junk like below: image
Please help me in this It's taking time but coundn't find any solution. Please respond AQAP.
Thanks in advance.