Fixes #1248. Handle blobs in addition to data URIs in bugform.js#1253
Fixes #1248. Handle blobs in addition to data URIs in bugform.js#1253
Conversation
|
r? @denschub -- mind taking a quick look to see if I'm not doing anything insane? It's mostly just re-using an existing method to convert a blob into a dataURI. |
denschub
left a comment
There was a problem hiding this comment.
There is a test for base64 uploading, and it would be nice to have a test for uploading blobs as well, just to make sure we don't regress that by accident. Ultimately, we are going to use that in our embedded extension, so this path is even more important than direct data URI uploads.
However, that's a nice-to-have and I am not going to block on that, r+.
| if (event.data instanceof Blob) { | ||
| // showUploadPreview will take care of converting from blob to | ||
| // dataURI, and will send the result to resampleIfNecessaryAndUpload. | ||
| this.showUploadPreview(event.data); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
|
Thanks! I agree the naming of the methods feels a bit weird, and will add a test before merging. |
|
Even better then. r++! |
|
Tests are green, bombs away. 💣 |
This allows the Firefox "Report Site Issue" feature to postMessage screenshot blobs, in addition to the base64 data URIs that Fennec and the rest of the addons send.
See #1252 for making everything send blobs.
(Still need to write a test for image-uploads-non-auth.js, so not ready for merge.)