Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

copy about:support to pastebin menu entry is broken #86

Open
whimboo opened this Issue · 10 comments

3 participants

@whimboo
Owner

When you try the above mentioned command you will get the following entry in the Error Console:

Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIWebNavigation.loadURI]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://global/content/bindings/browser.xml :: loadURIWithFlags :: line 156" data: no]
Source File: chrome://browser/content/tabbrowser.xml
Line: 1358

@xabolcs
Owner

with Firefox 12 (Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20100101 Firefox/12.0 ID:20120417165043) the new tab would open with THIS API HAS BEEN DISABLED. Please use Pastebin's new API. http://pastebin.com/api "URL" which causes the exception.

But http://pastebin.com/api redirects to the login page. Do we like that (read: login required services)? :(
Are there any way to use pastebin.m.o instead?

@whimboo
Owner

For Firefox and SeaMonkey we could use loadURI and simply submit the data via the postData parameter:
http://mxr.mozilla.org/mozilla-central/source/browser/base/content/browser.js#2142

But not sure if that would work in Thunderbird.

Would you mind posting a link to our current source?

@xabolcs
Owner

Related Pastebin.com tweet is below:

Today we disabled Pastebin's old API. Right now only the new API works. Please adjust your apps/tools if you haven't already.

whimboo wrote:

Would you mind posting a link to our current source?

pastebin() is at nightly.js#L229. It operates with xhr.
Could be easily tested with Error Console - copy body of pastebin() and let go. :)

@whimboo
Owner

I would say lets try it out with our own pastebin version at mozilla.org.

@xabolcs
Owner

Sad news from google about pastebin.m.o: Bug 610766 is RESOLVED WORKFORME.

But at least it provides alternatives: https://github.com/bartTC/django-paste, https://github.com/oremj/pastebinit/

@xabolcs
Owner

dpaste.de / dpaste.com works with the new FormData() introduced in Gecko 2.0. So I hope new MultipartFormData()could do the trick too. :)

I'm wondering that multipartFormData.js from screenshot directory should be a shared module. Hm?
Updated nightly.pastebin() will use it too!

@xabolcs
Owner

Good news: I'm able to send to pastebin.m.o with XHR (as nightly.pastebin() does) and new MultipartFormData().
Bad news: pastebin.m.o doesn't like current implementation of MultipartFormData and delays the response with 60 seconds!

A request with FormData:

    Fd is instance of MultipartFormData: false
    Fd is instance of FormData: true
    Xhr sent to http://pastebin.mozilla.org/
    Xhr changed state to 2 in 870ms
    Xhr changed state to 3 in 870ms
    Xhr changed state to 3 in 876ms
    Xhr changed state to 3 in 876ms
    Xhr changed state to 3 in 879ms
    http://pastebin.mozilla.org/1746450
    Xhr done in 879ms

A request with NTT's own MultipartFormData:

    Fd is instance of MultipartFormData: true
    Fd is instance of FormData: false
    Xhr sent to http://pastebin.mozilla.org/
    Xhr changed state to 2 in 61012ms
    Xhr changed state to 3 in 61012ms
    Xhr changed state to 3 in 61012ms
    Xhr changed state to 3 in 61015ms
    http://pastebin.mozilla.org/1746451
    Xhr done in 61015ms

Hey pastebin, wtf R U doin?

I'm going to dig into this, and try to improve MultipartFormData. I wouldn't like drop it due to compatibility reasons.

@xabolcs
Owner

Interestingly MultipartFormData works flawlessly with pastebin.m.o under Gecko 1.9.x
Other trivial XHR implemetations are slowed down too (under recent Applications).
A workaround is for example to create the <form/> element and submitting that.
But that doesn't work well with Thunderbird.

So I used FormData where possible, and falled back to MultipartFormData otherwise.
The fallback case could be improved if MultipartFormData got modularized or reverted back to Component.

@xabolcs xabolcs referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@xabolcs xabolcs referenced this issue from a commit in xabolcs/nightlytt
@xabolcs xabolcs Issue #86 - use pastebin.m.o with FormData where applicable.
Other improvements: disable menuitem while sending, Thunderbird support.
69fbf85
@xabolcs xabolcs was assigned
@xabolcs xabolcs referenced this issue from a commit in xabolcs/nightlytt
@xabolcs xabolcs Issue #86 - addressing comments, part 1:
- onErrorCallback
- const pastebinURL
- triple operator 200
- pastebinAboutSupport space
- import multipartFormData.js
fa30297
@xabolcs xabolcs referenced this issue from a commit in xabolcs/nightlytt
@xabolcs xabolcs Issue #86 - addressing comments, part 1.5:
- refresh pastebin() call in pastebinAboutSupport
75c329e
@qguv

I'm experiencing the same issue @xabolcs got 2 years ago:
THIS API HAS BEEN DISABLED. Please use Pastebin's new API. http://pastebin.com/api

@xabolcs
Owner

@qguv if you are interested, you could try the xpi from development channel! It have a fix, which uses pastebin.mozilla.org instead pastebin.com.

@xabolcs xabolcs added this to the 3.8 milestone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.