Skip to content

Fixes #1248. Handle blobs in addition to data URIs in bugform.js#1253

Merged
miketaylr merged 2 commits intomasterfrom
issues/1248/1
Dec 23, 2016
Merged

Fixes #1248. Handle blobs in addition to data URIs in bugform.js#1253
miketaylr merged 2 commits intomasterfrom
issues/1248/1

Conversation

@miketaylr
Copy link
Copy Markdown
Member

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.)

@miketaylr
Copy link
Copy Markdown
Member Author

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.

Copy link
Copy Markdown
Member

@denschub denschub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@miketaylr
Copy link
Copy Markdown
Member Author

Thanks! I agree the naming of the methods feels a bit weird, and will add a test before merging.

@denschub
Copy link
Copy Markdown
Member

Even better then. r++!

@miketaylr miketaylr merged commit a6cdde4 into master Dec 23, 2016
@miketaylr miketaylr deleted the issues/1248/1 branch December 23, 2016 19:42
@miketaylr
Copy link
Copy Markdown
Member Author

Tests are green, bombs away. 💣

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants