Closed KOLANICH closed 7 years ago
Partially covered in PR #93.
Which other places would need an update?
Screenshot uploader, of course. PS you don't need to fix IH, I think we should replace it with imgur.
PS you don't need to fix IS, I think we should replace it with imgur.
See Issue #49 and the PR for that!
Ok, so both cases when we make use of MultipartFormData are listed now. So once those issues are fixed we can also remove the multipartFormData.js file, right? If that is the case we can update the summary of this issue to reflect the removal of this module.
So once those issues are fixed we can also remove the multipartFormData.js file, right?
@whimboo, removing this module is equal to upping the <minVersion>
of toolkit@mozilla.org
and it's friends at least to 2.0
, a.k.a. Issue #161.
Then this issue also depends on #161, which can be done after the next release I think.
The migration of screenshot uploader isn't trivial.
The migration of screenshot uploader isn't trivial.
Because nsIWebNavigation.loadURI()
needs nsIInputStream
for postData
and for headers
and FormData
doesn't know about those.
Can we use Blob there?
No need for Blob, IMHO. Picture data are transmitted as base64, so FormData
would be good at screenshot upload, but screenshot uploader currently uses webNavigation.loadURI()
instead xhr.send()
.
Of course there is a way to rewrite screenshot uploader to use xhr to allow this multipartFormData
FormData
change, but I think this wouldn't be the correct way.
This transition would shrink not just userbase (Gecko 2.0 and up), but the functionality too: FormData
does support xhr.send()
only.
For example see this SO question: How to pass formData to postData in loadOneTab? and the referenced answer from @nmaier.
Base64 is evil, let's send as binary.
how-to-pass-formdata-to-postdata-in-loadonetab
why not just extract redirection url via getResponseHeader() and open tab for it? Or just use API?
why not just extract redirection url via getResponseHeader() and open tab for it?
Yeah, this is the "rewrite screenshot uploader to use xhr.send()
to allow us use FormData
" case I mentioned above.
For screenshot uploader there is a provider.js
, and it would be nice to add even more upload target, and I wouldn't like to limit them to being XHR compatible.
So screenshot.js:submitScreenshot()
should simply do a fileService.submitImageAndOpenLandingPage(postData);
call or something like, instead of doing magic.
Offtopic, but I would like to add something like for text upload (pastebin providers).
Or just use API?
API for what?
Base64 is evil, let's send as binary.
Should I file an issue for you, @KOLANICH ?
No, I've no time for rewriting the addon.
To sum up this issue, I vote for wontfix
to "use FormData
instead of multipartFormData.js
", because it doesn't support loadOneTab
, loadURI
and others.
Of course multipartFormData.js
needs work:
POST
s to pastebin.m.oI still vote for enchancement
and against wontfix
.
With the rewrite of the extension the pastebin feature is gone at the moment. We will have to re-implement it, and which is covered by issue #251.
Why don't you use FormData instead of multipartFormData.js?