Skip to content
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

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

Merged
merged 2 commits into from
Dec 23, 2016

Conversation

miketaylr
Copy link
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
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
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
Member Author

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

@denschub
Copy link
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
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